From: Stephen Soltesz Date: Wed, 24 Dec 2008 18:13:29 +0000 (+0000) Subject: A disabled or diagnostic-mode node will contact PLC (download BM and interact X-Git-Tag: PLCAPI-4.3-3~14 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=2c4cbe5fb2105d0fc1a3661905bfc2fbee20f0e0;p=plcapi.git A disabled or diagnostic-mode node will contact PLC (download BM and interact 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'. --- diff --git a/PLC/Methods/BootUpdateNode.py b/PLC/Methods/BootUpdateNode.py index 9da550f..4589d51 100644 --- a/PLC/Methods/BootUpdateNode.py +++ b/PLC/Methods/BootUpdateNode.py @@ -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