From 34014a24d55b7c2165d1e2b266b298cd38c52721 Mon Sep 17 00:00:00 2001 From: Gilles DAVID Date: Tue, 14 May 2019 17:21:20 +0200 Subject: [PATCH] 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. --- bin/runSession.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) 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) -- 2.39.2