return "%s@%s"%(self.username,self.hostname)
# command gets run on the right box
- def actual_command (self, command):
+ def actual_command (self, command,keep_stdin=False):
if self.is_local():
return command
ssh_command = "ssh "
+ if not keep_stdin:
+ ssh_command += "-n "
ssh_command += TestSsh.std_options
ssh_command += self.key_part()
ssh_command += "%s %s" %(self.hostname_part(),TestSsh.backslash_shell_specials(command))
def run(self, command,background=False):
local_command = self.actual_command(command)
- if background:
- local_command += " &"
- return utils.system(local_command)
+ return utils.system(local_command,background)
def clean_dir (self,dirname):
if self.is_local():
command += self.key_part()
command += "%s:%s/%s %s"%(self.hostname_part(),self.buildname,remote_file,local_file)
utils.system(command)
+
+ # this is only to avoid harmless message when host cannot be identified
+ # convenience only
+ # the only place where this is needed is when tring to reach a slice in a node,
+ # which is done from the test master box
+ def clear_known_hosts (self):
+ known_hosts = "%s/.ssh/known_hosts"%os.getenv("HOME")
+ utils.header("Clearing entry for %s in %s"%(self.hostname,known_hosts))
+ utils.system("sed -i -e /^%s/d %s"%(self.hostname,known_hosts))
+