summaryrefslogtreecommitdiff
path: root/qpid/python/examples/api/drain
diff options
context:
space:
mode:
Diffstat (limited to 'qpid/python/examples/api/drain')
-rwxr-xr-xqpid/python/examples/api/drain8
1 files changed, 2 insertions, 6 deletions
diff --git a/qpid/python/examples/api/drain b/qpid/python/examples/api/drain
index 372426c801..a2e40ec8a0 100755
--- a/qpid/python/examples/api/drain
+++ b/qpid/python/examples/api/drain
@@ -51,7 +51,6 @@ if opts.verbose:
else:
enable("qpid", WARN)
-url = URL(opts.broker)
if args:
addr = args.pop(0)
else:
@@ -72,15 +71,12 @@ class Formatter:
def __getitem__(self, st):
return eval(st, self.environ)
-# XXX: should make URL default the port for us
-conn = Connection(url.host, url.port,
- username=url.user,
- password=url.password,
+conn = Connection(opts.broker,
reconnect=opts.reconnect,
reconnect_interval=opts.reconnect_interval,
reconnect_limit=opts.reconnect_limit)
try:
- conn.connect()
+ conn.open()
ssn = conn.session()
rcv = ssn.receiver(addr)