fix a bug
This commit is contained in:
parent
a17aff2b20
commit
ff7c5b04df
|
@ -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'
|
||||
|
|
Loading…
Reference in New Issue