diff options
author | Rafael H. Schloming <rhs@apache.org> | 2009-12-17 04:58:31 +0000 |
---|---|---|
committer | Rafael H. Schloming <rhs@apache.org> | 2009-12-17 04:58:31 +0000 |
commit | 9c5549a09d261f3a66ce569560af7baf14d48d25 (patch) | |
tree | 18b93d3f4fe96c7ef589d457d3b2159eb73ce050 /python/qpid/driver.py | |
parent | 6f485818cbf237cdcd6fd3bfc7215b61f3656e14 (diff) | |
download | qpid-python-9c5549a09d261f3a66ce569560af7baf14d48d25.tar.gz |
QPID-2287: added an address option for declaring queues with multiple bindings
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@891537 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'python/qpid/driver.py')
-rw-r--r-- | python/qpid/driver.py | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/python/qpid/driver.py b/python/qpid/driver.py index 3cc69921bb..e31276ad7b 100644 --- a/python/qpid/driver.py +++ b/python/qpid/driver.py @@ -605,6 +605,7 @@ class Driver: cmd = ExchangeDeclare(exchange=name, durable=durable) elif type == "queue": cmd = QueueDeclare(queue=name, durable=durable) + bindings = xprops.pop("bindings", []) else: return ("unrecognized type, must be topic or queue: %s" % type,) @@ -621,9 +622,20 @@ class Driver: else: subtype = None + cmds = [cmd] + if type == "queue": + for b in bindings: + try: + n, s, o = address.parse(b) + except address.ParseError, e: + return (e,) + cmds.append(ExchangeBind(name, n, s, o)) + + for c in cmds[:-1]: + sst.write_cmd(c) def do_action(): action(type, subtype) - sst.write_cmd(cmd, do_action) + sst.write_cmd(cmds[-1], do_action) def delete(self, sst, name, action): def do_delete(er, qr): |