diff options
author | Sasha Aliashkevich | 2012-11-28 10:37:27 +0000 |
---|---|---|
committer | Sasha Aliashkevich | 2012-11-28 10:37:27 +0000 |
commit | 5a83be074ee7d930c743ebadd259cd7109747b22 (patch) | |
tree | cb3ca65302047e78167d3c1548330da361883e31 /python | |
parent | 53bf5f6c28f428adc2654de9d53b60671c4019e1 (diff) |
node-status cleanup
Diffstat (limited to 'python')
-rw-r--r-- | python/pgq/cascade/admin.py | 37 |
1 files changed, 17 insertions, 20 deletions
diff --git a/python/pgq/cascade/admin.py b/python/pgq/cascade/admin.py index 02f8877f..c581021d 100644 --- a/python/pgq/cascade/admin.py +++ b/python/pgq/cascade/admin.py @@ -36,6 +36,7 @@ Node Administration: wait-root Wait until node has catched up to root wait-provider Wait until node has catched up to provider status Show cascade state + node-status Show status of a local node members Show members in set Cascade layout change: @@ -385,26 +386,22 @@ class CascadeAdmin(skytools.AdminScript): """ Show status of a local node. """ - try: - self.load_local_info() - db = self.get_node_database(self.local_node) - curs = db.cursor() - node = self.queue_info.local_node - node.load_status(curs) - self.load_extra_status(curs, node) - - subscriber_nodes = self.get_node_subscriber_list(self.local_node) - - offset=4*' ' - print node.get_title() - print offset+'Provider: %s' % node.provider_node - print offset+'Subscribers: %s' % ', '.join(subscriber_nodes) - for l in node.get_infolines(): - print offset+l - - except DBError, d: - msg = str(d).strip().split('\n', 1)[0] - print('Node %s failure: %s' % (self.local_node, msg)) + + self.load_local_info() + db = self.get_node_database(self.local_node) + curs = db.cursor() + node = self.queue_info.local_node + node.load_status(curs) + self.load_extra_status(curs, node) + + subscriber_nodes = self.get_node_subscriber_list(self.local_node) + + offset=4*' ' + print node.get_title() + print offset+'Provider: %s' % node.provider_node + print offset+'Subscribers: %s' % ', '.join(subscriber_nodes) + for l in node.get_infolines(): + print offset+l def load_extra_status(self, curs, node): """Fetch extra info.""" |