From 20ed819acd6f85b1facda3b799d3c24b3ada7ad6 Mon Sep 17 00:00:00 2001 From: Alex Vasilenko Date: Tue, 19 Feb 2019 00:28:35 +0100 Subject: [PATCH] Fix exception handling in credtash lookup (#51099) Exception does not have property message and ansible returns completely different exception because of this --- lib/ansible/plugins/lookup/credstash.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ansible/plugins/lookup/credstash.py b/lib/ansible/plugins/lookup/credstash.py index 121a79afd69..0d2dbae854e 100644 --- a/lib/ansible/plugins/lookup/credstash.py +++ b/lib/ansible/plugins/lookup/credstash.py @@ -113,7 +113,7 @@ class LookupModule(LookupBase): except credstash.ItemNotFound: raise AnsibleError('Key {0} not found'.format(term)) except Exception as e: - raise AnsibleError('Encountered exception while fetching {0}: {1}'.format(term, e.message)) + raise AnsibleError('Encountered exception while fetching {0}: {1}'.format(term, e)) ret.append(val) return ret