diff --git a/nixops/backends/__init__.py b/nixops/backends/__init__.py index cbfd4734d..68836f8d7 100644 --- a/nixops/backends/__init__.py +++ b/nixops/backends/__init__.py @@ -271,7 +271,7 @@ def send_keys(self): def get_keys(self): return self.keys - def get_ssh_name(self): + def get_ssh_name(self, scp=False): assert False def get_ssh_flags(self, scp=False): @@ -390,7 +390,7 @@ def upload_file(self, source, target, recursive=False): cmdline = ["scp"] + self.get_ssh_flags(True) + master.opts if recursive: cmdline += ['-r'] - cmdline += [source, "root@" + self.get_ssh_name() + ":" + target] + cmdline += [source, "root@" + self.get_ssh_name(True) + ":" + target] return self._logged_exec(cmdline) def download_file(self, source, target, recursive=False): @@ -398,7 +398,7 @@ def download_file(self, source, target, recursive=False): cmdline = ["scp"] + self.get_ssh_flags(True) + master.opts if recursive: cmdline += ['-r'] - cmdline += ["root@" + self.get_ssh_name() + ":" + source, target] + cmdline += ["root@" + self.get_ssh_name(True) + ":" + source, target] return self._logged_exec(cmdline) def get_console_output(self): diff --git a/nixops/backends/none.py b/nixops/backends/none.py index 7222eb777..9be173f1d 100644 --- a/nixops/backends/none.py +++ b/nixops/backends/none.py @@ -67,8 +67,10 @@ def switch_to_configuration(self, method, sync, command=None): self._ssh_public_key_deployed = True return res - def get_ssh_name(self): + def get_ssh_name(self, scp=False): assert self.target_host + if scp and (":" in self.target_host): + return "[%s]" % (self.target_host) return self.target_host def get_ssh_private_key_file(self):