From 4bcb6d72d4af9d0abe1338939a023a57df3ee7a0 Mon Sep 17 00:00:00 2001 From: Stephen Soltesz Date: Thu, 17 Jun 2010 16:31:09 +0000 Subject: [PATCH] move all references to rec.plc_node_stats into the condition that checks it. --- commands/nodebad.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/commands/nodebad.py b/commands/nodebad.py index bdc0891..845d73c 100755 --- a/commands/nodebad.py +++ b/commands/nodebad.py @@ -43,20 +43,21 @@ def check_node_state(rec, node): run_level = rec.plc_node_stats['run_level'] last_contact = rec.plc_node_stats['last_contact'] node.plc_nodeid = rec.plc_node_stats['node_id'] + node.plc_siteid = rec.plc_node_stats['site_id'] + if len(rec.plc_node_stats['pcu_ids']) > 0: + node.haspcu = True + else: + node.haspcu = False else: boot_state = "unknown" last_contact = None + node.haspcu = False if boot_state == 'disable': boot_state = 'disabled' if boot_state == 'diag' or boot_state == 'diagnose': boot_state = 'safeboot' - if rec.plc_node_stats is not None and len(rec.plc_node_stats['pcu_ids']) > 0: - node.haspcu = True - else: - node.haspcu = False node.firewall = rec.firewall - node.plc_siteid = rec.plc_node_stats['site_id'] # NOTE: 'DOWN' and 'DEBUG' are temporary states, so only need # 'translations' into the node.status state -- 2.43.0