mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-30 22:31:25 -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
|
@ -144,7 +144,7 @@ class StrategyModule(StrategyBase):
|
|||
|
||||
try:
|
||||
included_files = IncludedFile.process_include_results(host_results, self._tqm, iterator=iterator, loader=self._loader, variable_manager=self._variable_manager)
|
||||
except AnsibleError, e:
|
||||
except AnsibleError as e:
|
||||
return False
|
||||
|
||||
if len(included_files) > 0:
|
||||
|
@ -153,7 +153,7 @@ class StrategyModule(StrategyBase):
|
|||
# list of noop tasks, to make sure that they continue running in lock-step
|
||||
try:
|
||||
new_blocks = self._load_included_file(included_file, iterator=iterator)
|
||||
except AnsibleError, e:
|
||||
except AnsibleError as e:
|
||||
for host in included_file._hosts:
|
||||
iterator.mark_host_failed(host)
|
||||
self._display.warning(str(e))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue