does not check for real nodes if not in boot state
Thierry Parmentelat [Tue, 5 Feb 2008 14:35:45 +0000 (14:35 +0000)]
system/TestNode.py
system/TestPlc.py

index 6ce35f7..a79c7c3 100644 (file)
@@ -22,6 +22,9 @@ class TestNode:
         model=self.node_spec['node_fields']['model']
         return model.find("qemu") >= 0
 
+    def is_real (self):
+        return (not self.is_vmware()) and (not self.is_qemu())
+
     def host_box (self):
         try:
             return self.node_spec['host_box']
index 6289fe2..4be0646 100644 (file)
@@ -116,6 +116,13 @@ class TestPlc:
                 return site
         raise Exception,"Cannot locate site %s"%sitename
         
+    def locate_node (self,nodename):
+        for site in self.plc_spec['sites']:
+            for node in site['nodes']:
+                if node['node_fields']['hostname'] == nodename:
+                    return (site,node)
+        raise Exception,"Cannot locate node %s"%nodename
+        
     def locate_key (self,keyname):
         for key in self.plc_spec['keys']:
             if key['name'] == keyname:
@@ -374,6 +381,13 @@ class TestPlc:
                 if boot_state == 'boot':
                     utils.header ("%s has reached the 'boot' state"%hostname)
                 else:
+                    # if it's a real node, never mind
+                    (site_spec,node_spec)=self.locate_node(hostname)
+                    test_node = TestNode(self,site_spec,node_spec)
+                    if test_node.is_real():
+                        utils.header("WARNING - Real node %s in %s - ignored"%(hostname,boot_state))
+                        # let's cheat
+                        boot_state = 'boot'
                     if datetime.datetime.now() > graceout:
                         utils.header ("%s still in '%s' state"%(hostname,boot_state))
                 status[hostname] = boot_state