Commit 448c89a0 by Michael DeHaan

It has been reported that occasionally the md5sum command on certain platforms…

It has been reported that occasionally the md5sum command on certain platforms (?) can fail, where I suspect there is noise in the output stream.

In those events, capture the output so we can report the error more properly.
parent d6b3f40c
......@@ -27,6 +27,7 @@ import time
import collections
import socket
import base64
import sys
import ansible.constants as C
import ansible.inventory
......@@ -463,8 +464,17 @@ class Runner(object):
cmd = " || ".join(md5s)
cmd = "%s; %s || (echo \"${rc} %s\")" % (test, cmd, path)
data = self._low_level_exec_command(conn, cmd, tmp, sudoable=False)
data = utils.last_non_blank_line(data)
return data.split()[0]
data2 = utils.last_non_blank_line(data)
try:
return data2.split()[0]
except:
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)
sys.stderr.write("----\n")
sys.stderr.write("output: %s\n" % data)
sys.stderr.write("----\n")
# this will signal that it changed and allow things to keep going
return "INVALIDMD5SUM"
# *****************************************************
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment