Commit 1aab7d19 authored by Julien Muchembled's avatar Julien Muchembled

Fix a log when no node is known

parent a7881b3c
...@@ -605,12 +605,13 @@ class NodeManager(object): ...@@ -605,12 +605,13 @@ class NodeManager(object):
def log(self): def log(self):
logging.info('Node manager : %u nodes', len(self._node_set)) logging.info('Node manager : %u nodes', len(self._node_set))
node_list = [(node, uuid_str(node.getUUID())) if self._node_set:
for node in sorted(self._node_set)] node_list = [(node, uuid_str(node.getUUID()))
max_len = max(len(x[1]) for x in node_list) for node in sorted(self._node_set)]
for node, uuid in node_list: max_len = max(len(x[1]) for x in node_list)
address = node.getAddress() or '' for node, uuid in node_list:
if address: address = node.getAddress() or ''
address = '%s:%d' % address if address:
logging.info(' * %*s | %8s | %22s | %s', address = '%s:%d' % address
max_len, uuid, node.getType(), address, node.getState()) logging.info(' * %*s | %8s | %22s | %s',
max_len, uuid, node.getType(), address, node.getState())
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