2 # this models a box that hosts qemu nodes
3 # could probably also be used for boxes that host plc instances
8 def __init__(self,hostname,key=None):
13 return utils.is_local (self.hostname)
15 def run (self,command):
17 return utils.system(command)
20 to_run="ssh -i %s.rsa %s %s"%(self.key,self.hostname,
21 utils.backslash_shell_specials(command))
23 to_run="ssh %s %s"%(self.hostname,
24 utils.backslash_shell_specials(command))
25 return utils.system(to_run)
27 def copy (self,local_file):
32 to_run="scp -i %s.rsa %s %s:"%(self.key,local_file,self.hostname)
34 to_run="scp %s %s:"%(local_file,self.hostname)
35 return utils.system(to_run)
37 def kill_all_qemus(self):
38 self.run("killall qemu")