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

storage: small code simplification

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