mirror of
https://github.com/munki/munki.git
synced 2026-04-20 19:50:36 -05:00
runScript should not crash Munki if the script it's attempting to run does not exist or there are other issues executing it.
This commit is contained in:
@@ -849,10 +849,15 @@ def runScript(itemname, path, scriptname):
|
||||
% (scriptname, itemname))
|
||||
|
||||
scriptoutput = []
|
||||
proc = subprocess.Popen(path, shell=False, bufsize=1,
|
||||
stdin=subprocess.PIPE,
|
||||
stdout=subprocess.PIPE,
|
||||
stderr=subprocess.STDOUT)
|
||||
try:
|
||||
proc = subprocess.Popen(path, shell=False, bufsize=1,
|
||||
stdin=subprocess.PIPE,
|
||||
stdout=subprocess.PIPE,
|
||||
stderr=subprocess.STDOUT)
|
||||
except OSError, e:
|
||||
munkicommon.display_error(
|
||||
'Error executing script %s: %s' % (scriptname, str(e)))
|
||||
return -1
|
||||
|
||||
while True:
|
||||
msg = proc.stdout.readline().decode('UTF-8')
|
||||
|
||||
Reference in New Issue
Block a user