Commit abaec8a0 authored by Aurel's avatar Aurel

-add itself into the node manager, a storage node must know in which

state it is
- remove useless code that check the same thing twice


git-svn-id: https://svn.erp5.org/repos/neo/branches/prototype3@601 71dcc9de-d417-0410-9af5-da40c76e7ee4
parent f01639bc
......@@ -157,16 +157,8 @@ class StorageEventHandler(EventHandler):
n = app.nm.getNodeByUUID(uuid)
n.setState(state)
raise OperationFailure
else:
# I know I'm running
continue
if n is None:
# try by address
n = app.nm.getNodeByServer(addr)
if n is not None:
# remove the node
app.nm.remode(n)
n = StorageNode(server = addr, uuid = uuid)
app.nm.add(n)
......@@ -186,6 +178,8 @@ class StorageEventHandler(EventHandler):
if n is not None:
logging.debug('removing client node %s', dump(uuid))
app.nm.remove(n)
if n is not None:
logging.info("added %s %s" %(dump(n.getUUID()), n.getServer()))
def handleAskLastIDs(self, conn, packet):
raise NotImplementedError('this method must be overridden')
......
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