From 07bd1e27c16d3034708f94079b77d8cd61e4ff82 Mon Sep 17 00:00:00 2001 From: Leon Riesebos Date: Thu, 27 May 2021 15:32:23 +0200 Subject: [PATCH] artiq_flash: wrap paramiko commands in bash login shell the login shell will load the nix environment on non-nixos systems Signed-off-by: Leon Riesebos --- artiq/remoting.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/artiq/remoting.py b/artiq/remoting.py index 41ca35928..3db4e7fc8 100644 --- a/artiq/remoting.py +++ b/artiq/remoting.py @@ -152,7 +152,12 @@ class SSHClient(Client): if get_pty: chan.get_pty() cmd = " ".join([shlex.quote(arg.format(tmp=self._tmpr, **kws)) for arg in cmd]) - logger.debug("Executing {}".format(cmd)) + + # Wrap command in a bash login shell + cmd = "exec {}".format(cmd) + cmd = "bash --login -c {}".format(shlex.quote(cmd)) + + logger.debug("Executing: {}".format(cmd)) chan.exec_command(cmd) return chan