forked from M-Labs/artiq
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 <leon.riesebos@duke.edu>
This commit is contained in:
parent
2f808880d5
commit
ae137d1c9e
|
@ -152,7 +152,12 @@ class SSHClient(Client):
|
||||||
if get_pty:
|
if get_pty:
|
||||||
chan.get_pty()
|
chan.get_pty()
|
||||||
cmd = " ".join([shlex.quote(arg.format(tmp=self._tmpr, **kws)) for arg in cmd])
|
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)
|
chan.exec_command(cmd)
|
||||||
return chan
|
return chan
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue