summaryrefslogtreecommitdiff
path: root/python/commands/qpid-queue-stats
diff options
context:
space:
mode:
authorCarl C. Trieloff <cctrieloff@apache.org>2008-05-16 14:02:57 +0000
committerCarl C. Trieloff <cctrieloff@apache.org>2008-05-16 14:02:57 +0000
commit7b9e370d29da677d70dd98e3c254ac71a3b0b8ab (patch)
tree9018145704339cf72d0ca090e07665b4c7779131 /python/commands/qpid-queue-stats
parent250cb741a6ddff89fc77f0e8761113d606fb5bf7 (diff)
downloadqpid-python-7b9e370d29da677d70dd98e3c254ac71a3b0b8ab.tar.gz
QPID-1067 by tross
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@657069 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'python/commands/qpid-queue-stats')
-rwxr-xr-xpython/commands/qpid-queue-stats14
1 files changed, 10 insertions, 4 deletions
diff --git a/python/commands/qpid-queue-stats b/python/commands/qpid-queue-stats
index 8771c7dc5d..1a663797b1 100755
--- a/python/commands/qpid-queue-stats
+++ b/python/commands/qpid-queue-stats
@@ -29,7 +29,7 @@ from threading import Condition
from qpid.management import managementClient
from qpid.managementdata import Broker
from qpid.peer import Closed
-from qpid.connection import Connection
+from qpid.connection import Connection, ConnectionFailed
from qpid.util import connect
from time import sleep
@@ -67,8 +67,14 @@ class BrokerManager:
self.mclient = managementClient (self.spec, None, self.configCb, self.instCb)
self.mchannel = self.mclient.addChannel (self.conn.session(self.sessionId))
except socket.error, e:
- print "Connect Error:", e
- exit (1)
+ print "Socket Error %s - %s" % (e[0], e[1])
+ sys.exit (1)
+ except Closed, e:
+ print "Connect Failed %d - %s" % (e[0], e[1])
+ sys.exit (1)
+ except ConnectionFailed, e:
+ print "Connect Failed %d - %s" % (e[0], e[1])
+ sys.exit(1)
def setFilter(self,filter):
self.filter = filter
@@ -143,7 +149,7 @@ class BrokerManager:
def main():
p = optparse.OptionParser()
p.add_option('--broker-address','-a', default='localhost' , help='broker-addr is in the form: [username/password@] hostname | ip-address [:<port>] \n ex: localhost, 10.1.1.7:10000, broker-host:10000, guest/guest@localhost')
- p.add_option('--amqp-spec-file','-s', default='"/usr/share/amqp/amqp.0-10.xml', help='the path to the amqp spec file')
+ p.add_option('--amqp-spec-file','-s', default='/usr/share/amqp/amqp.0-10.xml', help='the path to the amqp spec file')
p.add_option('--filter','-f' ,default=None ,help='a list of comma separated queue names (regex are accepted) to show')
options, arguments = p.parse_args()