diff options
Diffstat (limited to 'python/commands/qpid-route')
| -rwxr-xr-x | python/commands/qpid-route | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/python/commands/qpid-route b/python/commands/qpid-route index a0755641c9..a7fbb17777 100755 --- a/python/commands/qpid-route +++ b/python/commands/qpid-route @@ -23,7 +23,7 @@ import getopt import sys import socket import qpid -import uuid +import os from qpid.management import managementClient from qpid.peer import Closed from qpid.connection import Connection @@ -80,15 +80,19 @@ class RouteManager: print "Connecting to broker: %s:%d" % (broker.host, broker.port) try: self.spec = qpid.spec.load (_specpath) + self.sessionId = "%s.%d" % (os.uname()[1], os.getpid()) self.conn = Connection (connect (broker.host, broker.port), self.spec) self.conn.start () self.mclient = managementClient (self.spec) - self.mch = self.mclient.addChannel (self.conn.session(str(uuid.uuid4()))) + self.mch = self.mclient.addChannel (self.conn.session(self.sessionId)) self.mclient.syncWaitForStable (self.mch) except socket.error, e: print "Connect Error:", e sys.exit (1) + def Disconnect (self): + self.mclient.removeChannel (self.mch) + def getLink (self): links = self.mclient.syncGetObjects (self.mch, "link") for link in links: @@ -268,4 +272,4 @@ else: rm.ClearAllRoutes () else: Usage () - +rm.Disconnect () |
