[stable-2.7] Use IndexError in exception (#49488)
(cherry picked from commit 6200d32c0d
)
Co-authored-by: Sam Doran <sdoran@redhat.com>
This commit is contained in:
parent
799f8e97b3
commit
91b2347344
2 changed files with 3 additions and 1 deletions
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
|
|
@ -189,7 +189,7 @@ class ActionModule(ActionBase):
|
||||||
if action_desc:
|
if action_desc:
|
||||||
try:
|
try:
|
||||||
error = to_text(e).splitlines()[-1]
|
error = to_text(e).splitlines()[-1]
|
||||||
except TypeError as e:
|
except IndexError as e:
|
||||||
error = to_text(e)
|
error = to_text(e)
|
||||||
display.debug("{0}: {1} fail '{2}', retrying in {3:.4} seconds...".format(self._task.action, action_desc,
|
display.debug("{0}: {1} fail '{2}', retrying in {3:.4} seconds...".format(self._task.action, action_desc,
|
||||||
error, fail_sleep))
|
error, fail_sleep))
|
||||||
|
|
Loading…
Reference in a new issue