From a9c16a6c90d50c729cb483590451e888f55609c2 Mon Sep 17 00:00:00 2001 From: John Westcott IV Date: Mon, 6 Jul 2020 09:18:14 -0400 Subject: [PATCH] Fixing undefined variabe --- awx_collection/plugins/lookup/tower_api.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/awx_collection/plugins/lookup/tower_api.py b/awx_collection/plugins/lookup/tower_api.py index 63e3d30be1..265f4ced07 100644 --- a/awx_collection/plugins/lookup/tower_api.py +++ b/awx_collection/plugins/lookup/tower_api.py @@ -125,7 +125,7 @@ class LookupModule(LookupBase): raise AnsibleError("Unclear response from API: {0}".format(response)) if response['status_code'] != 200: - raise AnsibleError("Failed to query the API: {0}".format(return_data.get('detail', return_data))) + raise AnsibleError("Failed to query the API: {0}".format(response['json'].get('detail', response['json']))) return_data = response['json']