Commit 3739fbae authored by Grégory Wisniewski's avatar Grégory Wisniewski

Reduce indentation.

git-svn-id: https://svn.erp5.org/repos/neo/trunk@1588 71dcc9de-d417-0410-9af5-da40c76e7ee4
parent 6302acca
...@@ -707,28 +707,29 @@ class Application(object): ...@@ -707,28 +707,29 @@ class Application(object):
# wait for all transaction to be finished # wait for all transaction to be finished
while True: while True:
self.em.poll(1) self.em.poll(1)
if not self.tm.hasPending(): if self.tm.hasPending():
if self.cluster_state == ClusterStates.RUNNING: continue
sys.exit("Application has been asked to shut down") if self.cluster_state == ClusterStates.RUNNING:
else: sys.exit("Application has been asked to shut down")
# no more transaction, ask clients to shutdown else:
logging.info("asking all clients to shutdown") # no more transaction, ask clients to shutdown
for c in self.em.getConnectionList(): logging.info("asking all clients to shutdown")
node = self.nm.getByUUID(c.getUUID()) for c in self.em.getConnectionList():
if node.isClient(): node = self.nm.getByUUID(c.getUUID())
node_list = [(node.getType(), node.getAddress(), if node.isClient():
node.getUUID(), NodeStates.DOWN)] node_list = [(node.getType(), node.getAddress(),
c.notify(Packets.NotifyNodeInformation(node_list)) node.getUUID(), NodeStates.DOWN)]
# then ask storages and master nodes to shutdown c.notify(Packets.NotifyNodeInformation(node_list))
logging.info("asking all remaining nodes to shutdown") # then ask storages and master nodes to shutdown
for c in self.em.getConnectionList(): logging.info("asking all remaining nodes to shutdown")
node = self.nm.getByUUID(c.getUUID()) for c in self.em.getConnectionList():
if node.isStorage() or node.isMaster(): node = self.nm.getByUUID(c.getUUID())
node_list = [(node.getType(), node.getAddress(), if node.isStorage() or node.isMaster():
node.getUUID(), NodeStates.DOWN)] node_list = [(node.getType(), node.getAddress(),
c.notify(Packets.NotifyNodeInformation(node_list)) node.getUUID(), NodeStates.DOWN)]
# then shutdown c.notify(Packets.NotifyNodeInformation(node_list))
sys.exit("Cluster has been asked to shut down") # then shutdown
sys.exit("Cluster has been asked to shut down")
def identifyStorageNode(self, uuid, node): def identifyStorageNode(self, uuid, node):
state = NodeStates.RUNNING state = NodeStates.RUNNING
......
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