From 54587c1f612df7213926cc44373d0c936de05779 Mon Sep 17 00:00:00 2001 From: Joshua Boniface Date: Thu, 31 May 2018 23:37:48 -0400 Subject: [PATCH] Better reporting of nodes --- pvcd.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/pvcd.py b/pvcd.py index 52105224..5ff00519 100755 --- a/pvcd.py +++ b/pvcd.py @@ -68,15 +68,30 @@ node_list = [] def updatenodes(new_node_list): global node_list node_list = new_node_list + active_node_list = [] + flushed_node_list = [] + inactive_node_list = [] print('Node list: %s' % node_list) for node in node_list: if node in t_node: t_node[node].updatenodelist(node_list) + node_status = t_node[node].getstatus() else: t_node[node] = NodeInstance.NodeInstance(node, node_list, zk); if t_node[node].name == myhostname: t_node[node].start() + if node_status == 'start': + active_node_list.append(t_node[node].getname()) + elif node_status == 'flush': + flushed_node_list.append(t_node[node].getname()) + else: + inactive_node_list.append(t_node[node].getname()) + + print('Active nodes: %s' % active_node_list) + print('Flushed nodes: %s' % flushed_node_list) + print('Inactive nodes: %s' % inactive_node_list) + domain_list = zk.get_children('/domains') print('Domain list: %s' % domain_list)