- self.test_plc.server.DeleteNode(auth,self.name())
-
- def get_node_status(self,hostname):
- filter=['boot_state']
- status=False
- node_status=self.test_plc.server.GetNodes(self.test_plc.auth_root(),hostname, filter)
- utils.header('Actual status for node %s is [%s]'%(hostname,node_status))
- if (node_status[0]['boot_state'] == 'boot'):
- utils.header('%s has reached boot state'%hostname)
- status=True
- elif (node_status[0]['boot_state'] == 'dbg' ):
- utils.header('%s has reached debug state'%hostname)
- return status
-
- def conffile(self,image,hostname,path):
- model=self.node_spec['node_fields']['model']
- if self.is_vmware():
- host_box=self.host_box()
- template='%s/template-vmplayer/node.vmx'%(path)
- actual='%s/vmplayer-%s/node.vmx'%(path,hostname)
- sed_command="sed -e s,@BOOTCD@,%s,g %s > %s"%(image,template,actual)
- utils.header('Creating %s from %s'%(actual,template))
- utils.system(sed_command)
- elif self.is_qemu():
- host_box=self.host_box()
- mac=self.node_spec['network_fields']['mac']
- dest_dir="qemu-%s"%(hostname)
- utils.header('Storing the mac address for node %s'%hostname)
- file=open(path+'/qemu-'+hostname+'/MAC','a')
- file.write('%s\n'%mac)
- file.write(dest_dir)
- file.close()
- utils.header ('Transferring configuration files for node %s into %s '%(hostname,host_box))
- cleandir_command="ssh root@%s rm -rf %s"%(host_box, dest_dir)
- createdir_command = "ssh root@%s mkdir -p %s"%(host_box, dest_dir)
- utils.system(cleandir_command)
- utils.system(createdir_command)
- scp_command = "scp -r %s/qemu-%s/* root@%s:/root/%s"%(path,hostname,host_box,dest_dir)
- utils.system(scp_command)
-
- def create_boot_cd(self,path):
- model=self.node_spec['node_fields']['model']
- node_spec=self.node_spec
- hostname=node_spec['node_fields']['hostname']
- encoded=self.test_plc.server.GetBootMedium(self.test_plc.auth_root(), hostname, 'node-iso', '')
+ self.test_plc.apiserver.DeleteNode(auth,self.name())
+
+ # Do most of the stuff locally - will be pushed on host_box - *not* the plc - later if needed
+ def qemu_local_init(self):
+ "all nodes : init a clean local directory for holding node-dep stuff like iso image..."
+ utils.system("rm -rf %s"%self.nodedir())
+ utils.system("mkdir %s"%self.nodedir())
+ if not self.is_qemu():
+ return True
+ return utils.system("rsync -v -a --exclude .svn template-qemu/ %s/"%self.nodedir())==0
+
+ def bootcd(self):
+ "all nodes: invoke GetBootMedium and store result locally"
+ utils.header("Calling GetBootMedium for %s"%self.name())
+ options = []
+ if self.is_qemu():
+ options.append('serial')
+ options.append('no-hangcheck')
+ encoded=self.test_plc.apiserver.GetBootMedium(self.test_plc.auth_root(),
+ self.name(), 'node-iso', '', options)