From 2c4cbe5fb2105d0fc1a3661905bfc2fbee20f0e0 Mon Sep 17 00:00:00 2001 From: Stephen Soltesz Date: Wed, 24 Dec 2008 18:13:29 +0000 Subject: [PATCH] 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'. --- PLC/Methods/BootUpdateNode.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/PLC/Methods/BootUpdateNode.py b/PLC/Methods/BootUpdateNode.py index 9da550f1..4589d513 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 -- 2.47.0