mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-04-01 08:13:08 +00:00
Use IndexError in exception (#49488)
This commit is contained in:
2
changelogs/fragments/reboot-fix-exception-type.yaml
Normal file
2
changelogs/fragments/reboot-fix-exception-type.yaml
Normal file
@@ -0,0 +1,2 @@
|
||||
bugfixes:
|
||||
- reboot - use IndexError instead of TypeError in exception
|
||||
@@ -185,7 +185,7 @@ class ActionModule(ActionBase):
|
||||
if action_desc:
|
||||
try:
|
||||
error = to_text(e).splitlines()[-1]
|
||||
except TypeError as e:
|
||||
except IndexError as e:
|
||||
error = to_text(e)
|
||||
display.debug("{0}: {1} fail '{2}', retrying in {3:.4} seconds...".format(self._task.action, action_desc,
|
||||
error, fail_sleep))
|
||||
|
||||
Reference in New Issue
Block a user