X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=bin%2FrunSession.py;h=c83cf502f87d182ccc7f42ad8bdf7cae8d41c550;hb=d8edd4804d9e6513a17c497c1a30326d4ba0d677;hp=fde468001a926bcf7b8934023b0fe55f67104107;hpb=d2eba6b9e0622cef37027558edeef4f070bbb549;p=modules%2Fkernel.git diff --git a/bin/runSession.py b/bin/runSession.py index fde468001..c83cf502f 100644 --- a/bin/runSession.py +++ b/bin/runSession.py @@ -1,5 +1,5 @@ # -*- coding: iso-8859-1 -*- -# Copyright (C) 2007-2019 CEA/DEN, EDF R&D, OPEN CASCADE +# Copyright (C) 2007-2021 CEA/DEN, EDF R&D, OPEN CASCADE # # Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, # CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS @@ -150,6 +150,11 @@ User "myself" connects to remotemachine to run the script concatenate.py in os.environ['OMNIORB_CONFIG'] = fileOmniConfig # --- set environment variables for port and hostname of NamingService host, port = getNSparams() + try: + # keep short name for host, for a correct comparison with getShortHostName() later + host=host.split('.')[0] + except: + pass else: # No running session host = "no_host" @@ -308,10 +313,12 @@ def __runRemoteSession(sa_obj, params): tmp_in, tmp_out, tmp_script = __copyFiles(params.user, params.machine, script, sa_obj.args or [], sa_obj.out or []) # execute command on the remote SALOME application - command = "ssh %s@%s %s/salome shell " % (params.user, params.machine, params.directory) + command = "%s/salome shell" % (params.directory) if params.port: - command = command + "-p %s "%params.port - command = command + " %s %s args:%s"%(header, tmp_script, ",".join(tmp_in)) + command += " -p %s "%params.port + command += " %s %s args:%s"%(header, tmp_script, ",".join(tmp_in)) + # salome shell command must run in a login shell because of module function + command = "ssh %s@%s -t 'bash -l -c \"%s\"'" % (params.user, params.machine, command) print('[ SSH ] ' + command) os.system(command)