mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-07 22:02:50 +00:00
Not native, but text (#55676)
* use to_text instead of to_native * cleaned up some imports and other pyflakisms * fix missing lib messages
This commit is contained in:
@@ -143,9 +143,9 @@ class ActionModule(ActionBase):
|
||||
err_msg = "'search_paths' must be a string or flat list of strings, got {0}"
|
||||
try:
|
||||
incorrect_type = any(not is_string(x) for x in search_paths)
|
||||
except TypeError as te:
|
||||
raise AnsibleError(err_msg.format(search_paths))
|
||||
if not isinstance(search_paths, list) or incorrect_type:
|
||||
if not isinstance(search_paths, list) or incorrect_type:
|
||||
raise TypeError
|
||||
except TypeError:
|
||||
raise AnsibleError(err_msg.format(search_paths))
|
||||
|
||||
display.debug('{action}: running find module looking in {paths} to get path for "{command}"'.format(
|
||||
@@ -293,7 +293,7 @@ class ActionModule(ActionBase):
|
||||
reboot_result = self._low_level_execute_command(reboot_command, sudoable=self.DEFAULT_SUDOABLE)
|
||||
except AnsibleConnectionFailure as e:
|
||||
# If the connection is closed too quickly due to the system being shutdown, carry on
|
||||
display.debug('{action}: AnsibleConnectionFailure caught and handled: {error}'.format(action=self._task.action, error=to_native(e)))
|
||||
display.debug('{action}: AnsibleConnectionFailure caught and handled: {error}'.format(action=self._task.action, error=to_text(e)))
|
||||
reboot_result['rc'] = 0
|
||||
|
||||
result['start'] = datetime.utcnow()
|
||||
|
||||
Reference in New Issue
Block a user