diff options
Diffstat (limited to 'python')
-rwxr-xr-x | python/commands/qpid-config | 14 | ||||
-rwxr-xr-x | python/commands/qpid-route | 18 | ||||
-rw-r--r-- | python/qpid/management.py | 8 | ||||
-rw-r--r-- | python/qpid/managementdata.py | 2 |
4 files changed, 27 insertions, 15 deletions
diff --git a/python/commands/qpid-config b/python/commands/qpid-config index 8f2fb7ff1b..23a054f497 100755 --- a/python/commands/qpid-config +++ b/python/commands/qpid-config @@ -96,9 +96,9 @@ class BrokerManager: self.conn = Connection (connect (self.broker.host, self.broker.port), self.spec, username=self.broker.username, password=self.broker.password) self.conn.start () - self.session = self.conn.session(str(uuid4())) + self.session = self.conn.session (self.sessionId) self.mclient = managementClient (self.spec) - self.mchannel = self.mclient.addChannel (self.conn.session(self.sessionId)) + self.mchannel = self.mclient.addChannel (self.session) except socket.error, e: print "Socket Error:", e sys.exit (1) @@ -141,11 +141,11 @@ class BrokerManager: mch = self.mchannel mc.syncWaitForStable (mch) exchanges = mc.syncGetObjects (mch, "exchange") - print "Type Bindings Exchange Name" - print "=============================================" + print "Durable Type Bindings Exchange Name" + print "=======================================================" for ex in exchanges: if self.match (ex.name, filter): - print "%-10s%5d %s" % (ex.type, ex.bindings, ex.name) + print "%4c %-10s%5d %s" % (YN (ex.durable), ex.type, ex.bindings, ex.name) def ExchangeListRecurse (self, filter): self.ConnectToBroker () @@ -278,7 +278,7 @@ class BrokerManager: key = args[2] try: - self.session.exchange_bind (queue=qname, exchange=ename, routing_key=key) + self.session.exchange_bind (queue=qname, exchange=ename, binding_key=key) except Closed, e: print "Failed:", e @@ -293,7 +293,7 @@ class BrokerManager: key = args[2] try: - self.session.exchange_unbind (queue=qname, exchange=ename, routing_key=key) + self.session.exchange_unbind (queue=qname, exchange=ename, binding_key=key) except Closed, e: print "Failed:", e diff --git a/python/commands/qpid-route b/python/commands/qpid-route index baa45a320f..e59f89480e 100755 --- a/python/commands/qpid-route +++ b/python/commands/qpid-route @@ -83,7 +83,7 @@ class RouteManager: def getLink (self): links = self.mclient.syncGetObjects (self.mch, "link") for link in links: - if link.address == self.src.name (): + if "%s:%d" % (link.host, link.port) == self.src.name (): return link return None @@ -100,8 +100,13 @@ class RouteManager: print "Inter-broker link not found, creating..." connectArgs = {} - connectArgs["host"] = self.src.host - connectArgs["port"] = self.src.port + connectArgs["host"] = self.src.host + connectArgs["port"] = self.src.port + connectArgs["useSsl"] = False + connectArgs["durable"] = False + connectArgs["authMechanism"] = "ANONYMOUS" + connectArgs["username"] = "" + connectArgs["password"] = "" res = mc.syncCallMethod (self.mch, broker.id, broker.classKey, "connect", connectArgs) if _verbose: print "Connect method returned:", res.status, res.statusText @@ -122,6 +127,7 @@ class RouteManager: if _verbose: print "Creating inter-broker binding..." bridgeArgs = {} + bridgeArgs["durable"] = 0 bridgeArgs["src"] = exchange bridgeArgs["dest"] = exchange bridgeArgs["key"] = routingKey @@ -180,7 +186,7 @@ class RouteManager: myLink = link break if myLink != None: - print "%s %s %s %s" % (self.dest.name(), myLink.address, bridge.dest, bridge.key) + print "%s %s:%d %s %s" % (self.dest.name(), myLink.host, myLink.port, bridge.dest, bridge.key) def LoadRoutes (self, inFile): pass @@ -198,7 +204,7 @@ class RouteManager: myLink = link break if myLink != None: - print "Deleting Bridge: %s %s %s... " % (myLink.address, bridge.dest, bridge.key), + print "Deleting Bridge: %s:%d %s %s... " % (myLink.host, myLink.port, bridge.dest, bridge.key), res = mc.syncCallMethod (self.mch, bridge.id, bridge.classKey, "close") if res.status != 0: print "Error: %d - %s" % (res.status, res.statusText) @@ -208,7 +214,7 @@ class RouteManager: links = mc.syncGetObjects (self.mch, "link") for link in links: if _verbose: - print "Deleting Link: %s... " % link.address, + print "Deleting Link: %s:%d... " % (link.host, link.port), res = mc.syncCallMethod (self.mch, link.id, link.classKey, "close") if res.status != 0: print "Error: %d - %s" % (res.status, res.statusText) diff --git a/python/qpid/management.py b/python/qpid/management.py index 3595fdfc3c..d8f09d14ab 100644 --- a/python/qpid/management.py +++ b/python/qpid/management.py @@ -281,7 +281,13 @@ class managementClient: hdr = self.checkHeader (codec) if hdr == None: raise ValueError ("outer header invalid"); - self.parse (ch, codec, hdr[0], hdr[1]) + + if hdr[0] == 'p': + self.handlePackageInd (ch, codec) + elif hdr[0] == 'q': + self.handleClassInd (ch, codec) + else: + self.parse (ch, codec, hdr[0], hdr[1]) ch.accept(msg) def replyCb (self, ch, msg): diff --git a/python/qpid/managementdata.py b/python/qpid/managementdata.py index a0197ba7d2..1d99cc11bc 100644 --- a/python/qpid/managementdata.py +++ b/python/qpid/managementdata.py @@ -84,7 +84,7 @@ class ManagementData: def rawObjId (self, displayId): bank = displayId / 1000 id = displayId % 1000 - if bank < 3: + if bank < 5: objId = (bank << 24) + id else: objId = self.bootSequence + (bank << 24) + id |