mirror of
https://github.com/munki/munki.git
synced 2026-01-21 06:30:34 -06:00
If softwareupdate launchd job fails, return the expected dictionary structure, not an integer return code
This commit is contained in:
@@ -106,15 +106,6 @@ def run(options_list, catalog_url=None, stop_allowed=False):
|
||||
|
||||
display.display_debug1('softwareupdate cmd: %s', cmd)
|
||||
|
||||
try:
|
||||
job = launchd.Job(cmd)
|
||||
job.start()
|
||||
except launchd.LaunchdJobException as err:
|
||||
display.display_warning(
|
||||
'Error with launchd job (%s): %s', cmd, err)
|
||||
display.display_warning('Skipping softwareupdate run.')
|
||||
return -3
|
||||
|
||||
results['installed'] = []
|
||||
results['download'] = []
|
||||
results['failures'] = []
|
||||
@@ -122,6 +113,17 @@ def run(options_list, catalog_url=None, stop_allowed=False):
|
||||
results['exit_code'] = 0
|
||||
results['post_action'] = POSTACTION_NONE
|
||||
|
||||
try:
|
||||
job = launchd.Job(cmd)
|
||||
job.start()
|
||||
except launchd.LaunchdJobException as err:
|
||||
message = 'Error with launchd job (%s): %s' % (cmd, err)
|
||||
display.display_warning(message)
|
||||
display.display_warning('Skipping softwareupdate run.')
|
||||
results['exit_code'] = -3
|
||||
results['failures'].append(message)
|
||||
return results
|
||||
|
||||
last_output = None
|
||||
while True:
|
||||
if stop_allowed and processes.stop_requested():
|
||||
|
||||
Reference in New Issue
Block a user