mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-10-09 09:54:02 -07:00
Use 'except ... as' syntax
This syntax works on Python 2.6 through 3.x. lib/ansible/module_utils (and lib/ansible/modules) need to support Python 2.4, so I didn't touch those.
This commit is contained in:
parent
2ac931d6c9
commit
0c6ce31f76
24 changed files with 51 additions and 51 deletions
|
@ -41,7 +41,7 @@ class LookupModule(LookupBase):
|
|||
val = credstash.getSecret(term, **kwargs)
|
||||
except credstash.ItemNotFound:
|
||||
raise AnsibleError('Key {0} not found'.format(term))
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
raise AnsibleError('Encountered exception while fetching {0}: {1}'.format(term, e.message))
|
||||
ret.append(val)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue