mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Handle empty results from failed connections in _remote_md5()
Fixes #5800
This commit is contained in:
parent
2dbbf29421
commit
79645535c0
1 changed files with 6 additions and 1 deletions
|
@ -976,7 +976,12 @@ class Runner(object):
|
|||
data = self._low_level_exec_command(conn, cmd, tmp, sudoable=True)
|
||||
data2 = utils.last_non_blank_line(data['stdout'])
|
||||
try:
|
||||
return data2.split()[0]
|
||||
if data2 == '':
|
||||
# this may happen if the connection to the remote server
|
||||
# failed, so just return "INVALIDMD5SUM" to avoid errors
|
||||
return "INVALIDMD5SUM"
|
||||
else:
|
||||
return data2.split()[0]
|
||||
except IndexError:
|
||||
sys.stderr.write("warning: md5sum command failed unusually, please report this to the list so it can be fixed\n")
|
||||
sys.stderr.write("command: %s\n" % md5s)
|
||||
|
|
Loading…
Reference in a new issue