diff options
| author | Carl C. Trieloff <cctrieloff@apache.org> | 2008-04-24 15:24:51 +0000 |
|---|---|---|
| committer | Carl C. Trieloff <cctrieloff@apache.org> | 2008-04-24 15:24:51 +0000 |
| commit | e48979cba21658045c8ccb7fd17a8fb354fd7984 (patch) | |
| tree | 78f8717dfc7898d92d08627a9c17cdf5b604e7f5 /qpid/python/commands/qpid-config | |
| parent | 506e9145d1be22eb13560ec34658334d5211e5c7 (diff) | |
| download | qpid-python-e48979cba21658045c8ccb7fd17a8fb354fd7984.tar.gz | |
QPID-953 from tross
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk@651290 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/python/commands/qpid-config')
| -rwxr-xr-x | qpid/python/commands/qpid-config | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/qpid/python/commands/qpid-config b/qpid/python/commands/qpid-config index 20b08933a4..03a0fd8538 100755 --- a/qpid/python/commands/qpid-config +++ b/qpid/python/commands/qpid-config @@ -19,7 +19,7 @@ # under the License. # -import os, uuid +import os import getopt import sys import socket @@ -97,10 +97,11 @@ class BrokerManager: def ConnectToBroker (self): try: self.spec = qpid.spec.load (_specpath) + self.sessionId = "%s.%d" % (os.uname()[1], os.getpid()) self.conn = Connection (connect (self.broker.host, self.broker.port), self.spec) self.conn.start () self.mclient = managementClient (self.spec) - self.mchannel = self.mclient.addChannel (self.conn.session(str(uuid.uuid4()))) + self.mchannel = self.mclient.addChannel (self.conn.session(self.sessionId)) except socket.error, e: print "Socket Error:", e sys.exit (1) @@ -108,6 +109,9 @@ class BrokerManager: print "Connect Failed:", e sys.exit (1) + def Disconnect (self): + self.mclient.removeChannel (self.mchannel) + def Overview (self): self.ConnectToBroker () mc = self.mclient @@ -374,4 +378,4 @@ else: bm.Unbind (cargs[1:]) else: Usage () - +bm.Disconnect() |
