X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=bin%2FrunSession.py;h=c6676b8020708a55a737aae2ddb030d8a626cae1;hb=ee44cdc8da140e8f0aabaa1b9d9485939899cfdf;hp=9280c09d51870ec441fe81e95be35c698da172ae;hpb=66b7b8c5d71f081f82f5dad2a3221a53ba9e4ee5;p=modules%2Fkernel.git diff --git a/bin/runSession.py b/bin/runSession.py index 9280c09d5..c6676b802 100644 --- a/bin/runSession.py +++ b/bin/runSession.py @@ -159,7 +159,7 @@ User "myself" connects to remotemachine to run the script concatenate.py in 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": @@ -193,6 +193,7 @@ def __runLocalSession(command): 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 @@ -203,6 +204,7 @@ def __runLocalSession(command): if proc.returncode != 0: any_error = True + error_code = proc.returncode except: any_error = True pass @@ -213,7 +215,7 @@ def __runLocalSession(command): sys.stdout.write("".join(outmsg)) if errmsg: sys.stderr.write("".join(errmsg)) - sys.exit(1) + sys.exit(error_code) return 0 else: