Commit 934ce86d by Scott Cunningham

update credstash lookup plugin to use Python 2.4-compatible exception catching

parent 92327ba1
...@@ -45,7 +45,7 @@ class LookupModule(LookupBase): ...@@ -45,7 +45,7 @@ class LookupModule(LookupBase):
val = credstash.getSecret(term, **kwargs) val = credstash.getSecret(term, **kwargs)
except credstash.ItemNotFound: except credstash.ItemNotFound:
raise AnsibleError('Key {} not found'.format(term)) raise AnsibleError('Key {} not found'.format(term))
except Exception as e: except Exception, e:
raise AnsibleError('Encountered exception while fetching {}: {}'.format(term, e.message)) raise AnsibleError('Encountered exception while fetching {}: {}'.format(term, e.message))
ret.append(val) ret.append(val)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment