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):
self.response_queue = []
def __getConnection(self):
self.connection = ClientConnection(
self.em, self.handler, addr=self.server,
connector_handler=self.connector_handler)
while not self.connected and self.connection is not None:
self.em.poll(0)
if not self.connected:
self.connection = ClientConnection(
self.em, self.handler, addr=self.server,
connector_handler=self.connector_handler)
while not self.connected and self.connection is not None:
self.em.poll(0)
if self.connection is None:
raise NotReadyException
return self.connection
def __ask(self, packet):
# TODO: make thread-safe
connection = self.__getConnection()
if connection is None:
raise NotReadyException("Can't connect to admin node")
connection.ask(packet)
response_queue = self.response_queue
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