Author: justi9
Date: 2008-12-11 16:31:27 -0500 (Thu, 11 Dec 2008)
New Revision: 2985
Modified:
mgmt/trunk/cumin/python/cumin/tools.py
Log:
Rename the add-broker admin command to add-qmf-server.
Improve the server listing function, to match what other list commands
do.
Modified: mgmt/trunk/cumin/python/cumin/tools.py
===================================================================
--- mgmt/trunk/cumin/python/cumin/tools.py 2008-12-11 20:54:46 UTC (rev 2984)
+++ mgmt/trunk/cumin/python/cumin/tools.py 2008-12-11 21:31:27 UTC (rev 2985)
@@ -96,19 +96,19 @@
opt = CommandOption(command, "force")
opt.description = "Don't complain and just do it"
- command = self.AddBroker(self, "add-broker")
+ command = self.AddQmfServer(self, "add-qmf-server")
command.arguments = ("NAME", "URL")
- command.description = "Add a new broker called NAME at URL"
+ command.description = "Add a new QMF server called NAME at URL"
- command = self.RemoveBroker(self, "remove-broker")
+ command = self.RemoveQmfServer(self, "remove-qmf-server")
command.arguments = ("URL",)
- command.description = "Remove broker called NAME; requires --force"
+ command.description = "Remove QMF server called NAME; requires
--force"
opt = CommandOption(command, "force")
opt.description = "Don't complain and just do it"
- command = self.ListBrokers(self, "list-brokers")
- command.description = "List existing broker registrations"
+ command = self.ListQmfServers(self, "list-qmf-servers")
+ command.description = "List existing QMF servers"
command = self.AddUser(self, "add-user")
command.arguments = ("NAME",)
@@ -206,7 +206,7 @@
def run(self, opts, args):
self.parent.database.checkSchema()
- class AddBroker(Command):
+ class AddQmfServer(Command):
def run(self, opts, args):
try:
name, url = args[1:]
@@ -236,7 +236,7 @@
reg = BrokerRegistration(name=name, url=url)
reg.syncUpdate()
- class RemoveBroker(Command):
+ class RemoveQmfServer(Command):
def run(self, opts, args):
try:
name = args[1]
@@ -253,11 +253,20 @@
raise CommandException \
(self, "Broker '%s' is unknown", reg.name)
- class ListBrokers(Command):
+ class ListQmfServers(Command):
def run(self, opts, args):
- for reg in BrokerRegistration.select():
- print reg.name, reg.url
+ regs = BrokerRegistration.select()
+ print " ID Name URL"
+ print "---- --------------------
---------------------------------"
+
+ for reg in regs:
+ print "%4i %-20s %-20s" % (reg.id, reg.name, reg.url)
+
+ count = regs.count()
+
+ print "(%i server%s found)" % (count, ess(count))
+
class AddUser(Command):
def run(self, opts, args):
try:
Show replies by date