'bootcd', 'start_nodes',
'check-nodes', 'check-slices' ]
other_steps = [ 'fresh-install', 'stop', 'install_vserver_create', 'install_vserver_native',
- 'clean_sites', 'clean_slices' , 'clean_keys',
+ 'clean_sites', 'clean_nodes', 'clean_slices', 'clean_keys',
'stop_nodes' , 'db_dump' , 'db_restore',
]
self.node_spec['network_fields'])
self.test_plc.server.UpdateNode(auth, self.name(), filter)
+ def delete_node (self):
+ # uses the right auth as far as poss.
+ try:
+ ownername = self.node_spec['owner']
+ user_spec = self.test_site.locate_user(ownername)
+ test_user = TestUser(self.test_plc,self.test_site,user_spec)
+ auth = test_user.auth()
+ except:
+ aut=self.test_plc.auth_root()
+ self.test_plc.server.DeleteNode(auth,self.name())
+
def conffile(self,image,hostname,path):
template='%s/template-vmplayer/node.vmx'%(path)
actual='%s/vmplayer-%s/node.vmx'%(path,hostname)
return self.do_sites(options)
def clean_sites (self,options):
- return self.do_sites(options,"delete")
+ return self.do_sites(options,action="delete")
def do_sites (self,options,action="add"):
for site_spec in self.plc_spec['sites']:
test_site = TestSite (self,site_spec)
- if (action == "delete"):
+ if (action != "add"):
utils.header("Deleting site %s in %s"%(test_site.name(),self.name()))
test_site.delete_site()
# deleted with the site
return True
def nodes (self, options):
+ return self.do_nodes(options)
+ def clean_nodes (self, options):
+ return self.do_nodes(options,action="delete")
+
+ def do_nodes (self, options,action="add"):
for site_spec in self.plc_spec['sites']:
test_site = TestSite (self,site_spec)
- utils.header("Creating nodes for site %s in %s"%(test_site.name(),self.name()))
- for node_spec in site_spec['nodes']:
- utils.show_spec('Creating node %s'%node_spec,node_spec)
- test_node = TestNode (self,test_site,node_spec)
- test_node.create_node ()
+ if action != "add":
+ utils.header("Deleting nodes in site %s"%test_site.name())
+ for node_spec in site_spec['nodes']:
+ test_node=TestNode(self,test_site,node_spec)
+ utils.header("Deleting %s"%test_node.name())
+ test_node.delete_node()
+ else:
+ utils.header("Creating nodes for site %s in %s"%(test_site.name(),self.name()))
+ for node_spec in site_spec['nodes']:
+ utils.show_spec('Creating node %s'%node_spec,node_spec)
+ test_node = TestNode (self,test_site,node_spec)
+ test_node.create_node ()
return True
def bootcd (self, options):