|
|
@ -209,15 +209,15 @@ class ACIModule(object):
|
|
|
|
|
|
|
|
|
|
|
|
# Handle APIC response
|
|
|
|
# Handle APIC response
|
|
|
|
if query['status'] != 200:
|
|
|
|
if query['status'] != 200:
|
|
|
|
result['response'] = query['msg']
|
|
|
|
self.result['response'] = query['msg']
|
|
|
|
result['status'] = query['status']
|
|
|
|
self.result['status'] = query['status']
|
|
|
|
try:
|
|
|
|
try:
|
|
|
|
# APIC error
|
|
|
|
# APIC error
|
|
|
|
aci_response_json(self.result, query['body'])
|
|
|
|
aci_response_json(self.result, query['body'])
|
|
|
|
module.fail_json(msg='Query failed: %(error_code)s %(error_text)s' % self.result, **self.result)
|
|
|
|
self.module.fail_json(msg='Query failed: %(error_code)s %(error_text)s' % self.result, **self.result)
|
|
|
|
except KeyError:
|
|
|
|
except KeyError:
|
|
|
|
# Connection error
|
|
|
|
# Connection error
|
|
|
|
module.fail_json(msg='Query failed for %(url)s. %(msg)s' % query)
|
|
|
|
self.module.fail_json(msg='Query failed for %(url)s. %(msg)s' % query)
|
|
|
|
|
|
|
|
|
|
|
|
query = json.loads(resp.read())
|
|
|
|
query = json.loads(resp.read())
|
|
|
|
|
|
|
|
|
|
|
|