fix a bug

This commit is contained in:
ooooo 2016-05-04 20:08:50 +08:00
parent a17aff2b20
commit ff7c5b04df
1 changed files with 2 additions and 2 deletions

View File

@ -57,7 +57,7 @@ class Worker(object):
self.etcd.setkey("machines/runnodes/"+self.addr, "waiting")
[status, key] = self.etcd.getkey("machines/runnodes/"+self.addr)
if status:
self.key = generatekey("machines/runnodes/"+self.addr)
self.key = generatekey("machines/allnodes/"+self.addr)
else:
logger.error("get key failed. %s" % node)
sys.exit(1)
@ -73,7 +73,7 @@ class Worker(object):
# worker search all run nodes to judge how to init
value = 'init-new'
[status, runlist] = self.etcd.listdir("machines/runnodes")
[status, runlist] = self.etcd.listdir("machines/allnodes")
for node in runlist:
if node['key'] == self.key:
value = 'init-recovery'