Commit 38f535a2 authored by Vincent Pelletier's avatar Vincent Pelletier

Factorise some packet instanciations.

git-svn-id: https://svn.erp5.org/repos/neo/trunk@2638 71dcc9de-d417-0410-9af5-da40c76e7ee4
parent 9637a45a
...@@ -312,6 +312,7 @@ class Application(object): ...@@ -312,6 +312,7 @@ class Application(object):
ready = False ready = False
nm = self.nm nm = self.nm
queue = self.local_var.queue queue = self.local_var.queue
packet = Packets.AskPrimary()
while not ready: while not ready:
# Get network connection to primary master # Get network connection to primary master
index = 0 index = 0
...@@ -345,7 +346,7 @@ class Application(object): ...@@ -345,7 +346,7 @@ class Application(object):
self.trying_master_node) self.trying_master_node)
continue continue
try: try:
msg_id = conn.ask(Packets.AskPrimary(), queue=queue) msg_id = conn.ask(packet, queue=queue)
self._waitMessage(conn, msg_id, self._waitMessage(conn, msg_id,
handler=self.primary_bootstrap_handler) handler=self.primary_bootstrap_handler)
except ConnectionClosed: except ConnectionClosed:
...@@ -374,9 +375,9 @@ class Application(object): ...@@ -374,9 +375,9 @@ class Application(object):
neo.lib.logging.info('Initializing from master') neo.lib.logging.info('Initializing from master')
queue = self.local_var.queue queue = self.local_var.queue
# Identify to primary master and request initial data # Identify to primary master and request initial data
p = Packets.RequestIdentification(NodeTypes.CLIENT, self.uuid, None,
self.name)
while conn.getUUID() is None: while conn.getUUID() is None:
p = Packets.RequestIdentification(NodeTypes.CLIENT, self.uuid,
None, self.name)
self._waitMessage(conn, conn.ask(p, queue=queue), self._waitMessage(conn, conn.ask(p, queue=queue),
handler=self.primary_bootstrap_handler) handler=self.primary_bootstrap_handler)
if conn.getUUID() is None: if conn.getUUID() is None:
......
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