A disabled or diagnostic-mode node will contact PLC (download BM and interact
authorStephen Soltesz <soltesz@cs.princeton.edu>
Wed, 24 Dec 2008 18:13:29 +0000 (18:13 +0000)
committerStephen Soltesz <soltesz@cs.princeton.edu>
Wed, 24 Dec 2008 18:13:29 +0000 (18:13 +0000)
with the API), but there is no indication of this via the API.

This modification updates the 'last_contact' field just like GetSlivers.

Specifically, this allows the Node&PCU Registration Wizard to set a node to
'disable', and then wait for a tech to boot it and for the node to contact
PLC.  The wizard now has an indication, without entering production mode, that
the node has booted, and therefore that the wizard can continue.

This not fool-proof, since if the tech stops here, the node will remain in the
DB, but it will be 'disabled'.

PLC/Methods/BootUpdateNode.py

index 9da550f..4589d51 100644 (file)
@@ -59,7 +59,12 @@ class BootUpdateNode(Method):
             interface.update(interface_fields)
             interface.sync(commit = False)
 
+        # indicate that node has booted & contacted PLC.
+        if isinstance(self.caller, Node):
+            node = self.caller
+            node.update_last_contact()
+
         self.caller.sync(commit = True)
-       self.message = "Node updated: %s" % ", ".join(node_fields.keys())
+        self.message = "Node updated: %s" % ", ".join(node_fields.keys())
 
         return 1