Correctly reference variables (#27486)

This commit is contained in:
John R Barker 2017-07-31 14:26:15 +01:00 committed by GitHub
parent 19d119f43c
commit 66adb3d993

View file

@ -209,15 +209,15 @@ class ACIModule(object):
# Handle APIC response
if query['status'] != 200:
result['response'] = query['msg']
result['status'] = query['status']
self.result['response'] = query['msg']
self.result['status'] = query['status']
try:
# APIC error
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:
# 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())