os.environ['NSPORT'] = port
os.environ['NSHOST'] = host
- # determine running mode, taht is either 'local' or 'remote'
+ # determine running mode, that is either 'local' or 'remote'
here = getShortHostName()
mode = "local"
if host != here and host != "localhost" and host != "no_host":
for cmd in command:
single_cmd = cmd.strip().split(' ')
any_error = False
+ error_code = 1
try:
proc = subprocess.Popen(single_cmd)
(stdoutdata, stderrdata) = proc.communicate() # Wait for process to terminate
if proc.returncode != 0:
any_error = True
+ error_code = proc.returncode
except:
any_error = True
pass
sys.stdout.write("".join(outmsg))
if errmsg:
sys.stderr.write("".join(errmsg))
- sys.exit(1)
+ sys.exit(error_code)
return 0
else: