Commit 74b738ca authored by Aurel's avatar Aurel

retrieve node at the of the handler method to avoid undefined variable


git-svn-id: https://svn.erp5.org/repos/neo/branches/prototype3@717 71dcc9de-d417-0410-9af5-da40c76e7ee4
parent 5b71dae3
......@@ -62,6 +62,12 @@ class AdministrationEventHandler(MasterEventHandler):
def handleSetNodeState(self, conn, packet, uuid, state, modify_partition_table):
logging.info("set node state for %s-%s : %s" % (dump(uuid), state, modify_partition_table))
app = self.app
node = app.nm.getNodeByUUID(uuid)
if node is None:
p = protocol.protocolError('invalid uuid')
conn.notify(p)
return
if uuid == app.uuid:
# get message for self
if state == RUNNING_STATE:
......@@ -76,11 +82,6 @@ class AdministrationEventHandler(MasterEventHandler):
conn.answer(p, packet)
app.shutdown()
node = app.nm.getNodeByUUID(uuid)
if node is None:
p = protocol.protocolError('invalid uuid')
conn.notify(p)
return
if node.getState() == state:
# no change, just notify admin node
p = protocol.noError('node state changed')
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment