From: Gilles DAVID Date: Tue, 14 May 2019 15:21:20 +0000 (+0200) Subject: Fix command executed in a remote shell X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=34014a24d55b7c2165d1e2b266b298cd38c52721;p=modules%2Fyacs.git Fix command executed in a remote shell The salome shell command may load module environments, thus the 'module' command is needed. This command is only available in a login shell. --- diff --git a/bin/runSession.py b/bin/runSession.py index fde468001..7f4ec5dfe 100644 --- a/bin/runSession.py +++ b/bin/runSession.py @@ -308,10 +308,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)