Commit fa52609d authored by Grégory Wisniewski's avatar Grégory Wisniewski

Fix commit #1152.


git-svn-id: https://svn.erp5.org/repos/neo/branches/prototype3@1156 71dcc9de-d417-0410-9af5-da40c76e7ee4
parent 7d1e8677
...@@ -37,18 +37,19 @@ class NeoCTL(object): ...@@ -37,18 +37,19 @@ class NeoCTL(object):
self.response_queue = [] self.response_queue = []
def __getConnection(self): def __getConnection(self):
self.connection = ClientConnection( if not self.connected:
self.em, self.handler, addr=self.server, self.connection = ClientConnection(
connector_handler=self.connector_handler) self.em, self.handler, addr=self.server,
while not self.connected and self.connection is not None: connector_handler=self.connector_handler)
self.em.poll(0) while not self.connected and self.connection is not None:
self.em.poll(0)
if self.connection is None:
raise NotReadyException
return self.connection return self.connection
def __ask(self, packet): def __ask(self, packet):
# TODO: make thread-safe # TODO: make thread-safe
connection = self.__getConnection() connection = self.__getConnection()
if connection is None:
raise NotReadyException("Can't connect to admin node")
connection.ask(packet) connection.ask(packet)
response_queue = self.response_queue response_queue = self.response_queue
assert len(response_queue) == 0 assert len(response_queue) == 0
......
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