|
47 | 47 | from traitlets import Unicode
|
48 | 48 | from traitlets.config.configurable import LoggingConfigurable
|
49 | 49 |
|
| 50 | +from ..util import shlex_join |
50 | 51 | from ._win32support import forward_read_events
|
51 | 52 | from ._winhpcjob import IPControllerJob
|
52 | 53 | from ._winhpcjob import IPControllerTask
|
@@ -705,14 +706,14 @@ def sshx(ssh_cmd, cmd, remote_output_file, log=None):
|
705 | 706 |
|
706 | 707 | Uses nohup and pipes to put it in the background
|
707 | 708 | """
|
708 |
| - remote_cmd = shlex.join(cmd) |
| 709 | + remote_cmd = shlex_join(cmd) |
709 | 710 |
|
710 | 711 | full_remote_cmd = [
|
711 | 712 | f"nohup {remote_cmd} > {remote_output_file} 2>&1 </dev/null & echo __remote_pid=$!__"
|
712 | 713 | ]
|
713 | 714 | full_cmd = ssh_cmd + full_remote_cmd
|
714 | 715 | if log:
|
715 |
| - log.info(f"Running `{shlex.join(full_cmd)}`") |
| 716 | + log.info(f"Running `{shlex_join(full_cmd)}`") |
716 | 717 | out = check_output(full_cmd, input=None).decode("utf8", "replace")
|
717 | 718 | values = _ssh_outputs(out)
|
718 | 719 | if 'remote_pid' in values:
|
@@ -886,7 +887,7 @@ def get_output(self, remove=False):
|
886 | 887 | + [
|
887 | 888 | self.location,
|
888 | 889 | "--",
|
889 |
| - shlex.join(["rm", "-f", self.remote_output_file]), |
| 890 | + shlex_join(["rm", "-f", self.remote_output_file]), |
890 | 891 | ],
|
891 | 892 | input=None,
|
892 | 893 | )
|
@@ -1518,9 +1519,9 @@ def _context_default(self):
|
1518 | 1519 |
|
1519 | 1520 | @observe("program", "program_args")
|
1520 | 1521 | def _program_changed(self, change=None):
|
1521 |
| - self.context['program'] = shlex.join(self.program) |
1522 |
| - self.context['program_args'] = shlex.join(self.program_args) |
1523 |
| - self.context['program_and_args'] = shlex.join(self.program + self.program_args) |
| 1522 | + self.context['program'] = shlex_join(self.program) |
| 1523 | + self.context['program_args'] = shlex_join(self.program_args) |
| 1524 | + self.context['program_and_args'] = shlex_join(self.program + self.program_args) |
1524 | 1525 |
|
1525 | 1526 | @observe("n", "queue")
|
1526 | 1527 | def _update_context(self, change):
|
|
0 commit comments