##// END OF EJS Templates
SSHProxyLauncher edits per review...
MinRK -
Show More
@@ -603,14 +603,14 b' class SSHLauncher(LocalProcessLauncher):'
603 check_output(self.scp_cmd + [local, remote])
603 check_output(self.scp_cmd + [local, remote])
604
604
605 def send_files(self):
605 def send_files(self):
606 """send our files"""
606 """send our files (called before start)"""
607 if not self.send_files:
607 if not self.to_send:
608 return
608 return
609 for local_file, remote_file in self.to_send:
609 for local_file, remote_file in self.to_send:
610 self._send_file(local_file, remote_file)
610 self._send_file(local_file, remote_file)
611
611
612 def _fetch_file(self, remote, local):
612 def _fetch_file(self, remote, local):
613 """send a single file"""
613 """fetch a single file"""
614 full_remote = "%s:%s" % (self.location, remote)
614 full_remote = "%s:%s" % (self.location, remote)
615 self.log.info("fetching %s from %s", local, full_remote)
615 self.log.info("fetching %s from %s", local, full_remote)
616 for i in range(10):
616 for i in range(10):
@@ -618,15 +618,15 b' class SSHLauncher(LocalProcessLauncher):'
618 check = check_output(self.ssh_cmd + self.ssh_args + \
618 check = check_output(self.ssh_cmd + self.ssh_args + \
619 [self.location, 'test -e', remote, "&& echo 'yes' || echo 'no'"])
619 [self.location, 'test -e', remote, "&& echo 'yes' || echo 'no'"])
620 check = check.strip()
620 check = check.strip()
621 if check.strip() == 'no':
621 if check == 'no':
622 time.sleep(1)
622 time.sleep(1)
623 elif check.strip() == 'yes':
623 elif check == 'yes':
624 break
624 break
625 check_output(self.scp_cmd + [full_remote, local])
625 check_output(self.scp_cmd + [full_remote, local])
626
626
627 def fetch_files(self):
627 def fetch_files(self):
628 """override in subclass"""
628 """fetch remote files (called after start)"""
629 if not self.fetch_files:
629 if not self.to_fetch:
630 return
630 return
631 for remote_file, local_file in self.to_fetch:
631 for remote_file, local_file in self.to_fetch:
632 self._fetch_file(remote_file, local_file)
632 self._fetch_file(remote_file, local_file)
General Comments 0
You need to be logged in to leave comments. Login now