diff --git a/NodeInstance.py b/NodeInstance.py index 565013fd..4838e642 100644 --- a/NodeInstance.py +++ b/NodeInstance.py @@ -24,10 +24,11 @@ import os, sys, psutil, socket, time, libvirt, kazoo.client, threading, fencenod class NodeInstance(): # Initialization function - def __init__(self, name, t_node, s_domain, zk, config): + def __init__(self, this_node, name, t_node, s_domain, zk, config): # Passed-in variables on creation self.zk = zk self.config = config + self.this_node = this_node self.name = name self.state = 'stop' self.t_node = t_node @@ -49,10 +50,11 @@ class NodeInstance(): except AttributeError: self.state = 'stop' - if self.state == 'flush': - self.flush() - if self.state == 'unflush': - self.unflush() + if self.name = self.this_node: + if self.state == 'flush': + self.flush() + if self.state == 'unflush': + self.unflush() @zk.DataWatch('/nodes/{}/memfree'.format(self.name)) def watch_hypervisor_memfree(data, stat, event=""): diff --git a/pvcd.py b/pvcd.py index 7568adfe..71a509c7 100755 --- a/pvcd.py +++ b/pvcd.py @@ -161,7 +161,7 @@ def updatenodes(new_node_list): if node in t_node: t_node[node].updatenodelist(t_node) else: - t_node[node] = NodeInstance.NodeInstance(node, t_node, s_domain, zk, config) + t_node[node] = NodeInstance.NodeInstance(myhostname, node, t_node, s_domain, zk, config) @zk.ChildrenWatch('/domains') def updatedomains(new_domain_list):