Commit 3f516cd6 authored by Julien Muchembled's avatar Julien Muchembled

storage: small code simplification

parent f7f8533a
...@@ -41,8 +41,7 @@ class IdentificationHandler(EventHandler): ...@@ -41,8 +41,7 @@ class IdentificationHandler(EventHandler):
if uuid is None: if uuid is None:
if node_type != NodeTypes.STORAGE: if node_type != NodeTypes.STORAGE:
raise ProtocolError('reject anonymous non-storage node') raise ProtocolError('reject anonymous non-storage node')
handler = StorageOperationHandler(self.app) conn.setHandler(StorageOperationHandler(app))
conn.setHandler(handler)
else: else:
if uuid == app.uuid: if uuid == app.uuid:
raise ProtocolError("uuid conflict or loopback connection") raise ProtocolError("uuid conflict or loopback connection")
...@@ -60,9 +59,7 @@ class IdentificationHandler(EventHandler): ...@@ -60,9 +59,7 @@ class IdentificationHandler(EventHandler):
force = app.uuid < uuid force = app.uuid < uuid
else: else:
raise ProtocolError('reject non-client-or-storage node') raise ProtocolError('reject non-client-or-storage node')
# apply the handler and set up the connection conn.setHandler(handler(app))
handler = handler(self.app)
conn.setHandler(handler)
node.setConnection(conn, force) node.setConnection(conn, force)
# accept the identification and trigger an event # accept the identification and trigger an event
conn.answer(Packets.AcceptIdentification( conn.answer(Packets.AcceptIdentification(
......
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