diff options
Diffstat (limited to 'python')
-rwxr-xr-x | python/londiste.py | 2 | ||||
-rw-r--r-- | python/pgq/cascade/admin.py | 22 |
2 files changed, 23 insertions, 1 deletions
diff --git a/python/londiste.py b/python/londiste.py index 8c2919c8..536d83cd 100755 --- a/python/londiste.py +++ b/python/londiste.py @@ -46,7 +46,7 @@ Internal Commands: cmd_handlers = ( (('create-root', 'create-branch', 'create-leaf', 'members', 'tag-dead', 'tag-alive', - 'change-provider', 'rename-node', 'status', 'pause', 'resume', 'node-info', + 'change-provider', 'rename-node', 'status', 'node-status', 'pause', 'resume', 'node-info', 'drop-node', 'takeover', 'resurrect'), londiste.LondisteSetup), (('add-table', 'remove-table', 'add-seq', 'remove-seq', 'tables', 'seqs', 'missing', 'resync', 'wait-sync', 'wait-root', 'wait-provider', diff --git a/python/pgq/cascade/admin.py b/python/pgq/cascade/admin.py index 97e52f07..80064774 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: @@ -381,6 +382,27 @@ class CascadeAdmin(skytools.AdminScript): self.queue_info.print_tree() + def cmd_node_status(self): + """ + Show status of a local node. + """ + + 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.""" pass |