Properly decode installer error output before storing it with installer stdout, so that later if we have to display/print it we don't trigger an exception if we have both stdout and stderr captured.

This commit is contained in:
Greg Neagle
2020-05-04 13:43:12 -07:00
parent 6dff4db5d8
commit 46cf0d05f1

View File

@@ -198,12 +198,12 @@ def _run_installer(cmd, env_vars, packagename):
retcode = job.returncode()
if retcode != 0:
# append stdout to our installer output
installeroutput.extend(job.stderr.read().splitlines())
installeroutput.extend(job.stderr.read().decode("UTF-8").splitlines())
display.display_status_minor(
"Install of %s failed with return code %s" % (packagename, retcode))
display.display_error("-"*78)
for line in installeroutput:
display.display_error(line.decode("UTF-8").rstrip("\n"))
display.display_error(line.rstrip("\n"))
display.display_error("-"*78)
elif retcode == 0:
munkilog.log("Install of %s was successful." % packagename)