mirror of
https://github.com/munki/munki.git
synced 2026-05-12 15:28:51 -05:00
Attempt to deal with Catalina's startosinstall output formatting
This commit is contained in:
@@ -137,7 +137,8 @@ class Job(object):
|
||||
'''launchd job object'''
|
||||
|
||||
def __init__(self, cmd, environment_vars=None,
|
||||
job_label=None, cleanup_at_exit=True):
|
||||
job_label=None, cleanup_at_exit=True,
|
||||
universal_newlines=False):
|
||||
'''Initialize our launchd job'''
|
||||
tmpdir = osutils.tmpdir()
|
||||
|
||||
@@ -173,7 +174,8 @@ class Job(object):
|
||||
proc = subprocess.Popen(launchctl_cmd, shell=False, bufsize=-1,
|
||||
stdin=subprocess.PIPE,
|
||||
stdout=subprocess.PIPE,
|
||||
stderr=subprocess.PIPE)
|
||||
stderr=subprocess.PIPE,
|
||||
universal_newlines=universal_newlines)
|
||||
err = proc.communicate()[1].decode('UTF-8')
|
||||
if proc.returncode:
|
||||
raise LaunchdJobException(err)
|
||||
|
||||
@@ -322,7 +322,8 @@ class StartOSInstallRunner(object):
|
||||
env = {'NSUnbufferedIO': 'YES'}
|
||||
|
||||
try:
|
||||
job = launchd.Job(cmd, environment_vars=env, cleanup_at_exit=False)
|
||||
job = launchd.Job(cmd, environment_vars=env, cleanup_at_exit=False,
|
||||
universal_newlines=True)
|
||||
job.start()
|
||||
except launchd.LaunchdJobException as err:
|
||||
display.display_error(
|
||||
@@ -365,7 +366,7 @@ class StartOSInstallRunner(object):
|
||||
startosinstall_output.append(info_output)
|
||||
|
||||
# parse output for useful progress info
|
||||
msg = info_output.rstrip('\n')
|
||||
msg = info_output.rstrip('\n\r')
|
||||
if msg.startswith('Preparing to '):
|
||||
display.display_status_minor(msg)
|
||||
elif msg.startswith('Preparing '):
|
||||
|
||||
Reference in New Issue
Block a user