diff options
author | Gordon Sim <gsim@apache.org> | 2008-04-29 21:00:18 +0000 |
---|---|---|
committer | Gordon Sim <gsim@apache.org> | 2008-04-29 21:00:18 +0000 |
commit | 602cbb3b53abc2719f52f0917cc7c2d66c412d2c (patch) | |
tree | 698e4b11a602f01e1439ddc6af0ce46baf5bdf76 | |
parent | 68d2ef6ed8e74e312ba8da5a1a9e83c1a099406a (diff) | |
download | qpid-python-602cbb3b53abc2719f52f0917cc7c2d66c412d2c.tar.gz |
QPID-981: allow id and exclude list to be passed through when creating a bridge with qpid-route
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@652114 13f79535-47bb-0310-9956-ffa450edef68
-rwxr-xr-x | python/commands/qpid-route | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/python/commands/qpid-route b/python/commands/qpid-route index a7fbb17777..b08293fa00 100755 --- a/python/commands/qpid-route +++ b/python/commands/qpid-route @@ -30,7 +30,7 @@ from qpid.connection import Connection from qpid.util import connect def Usage (): - print "Usage: qpid-route [OPTIONS] add <dest-broker> <src-broker> <exchange> <routing-key>" + print "Usage: qpid-route [OPTIONS] add <dest-broker> <src-broker> <exchange> <routing-key> [id] [exclude-list]" print " qpid-route [OPTIONS] del <dest-broker> <src-broker> <exchange> <routing-key>" print " qpid-route [OPTIONS] list <dest-broker>" #print " qpid-route [OPTIONS] load <filename>" @@ -100,7 +100,7 @@ class RouteManager: return link return None - def AddRoute (self, srcBroker, exchange, routingKey): + def AddRoute (self, srcBroker, exchange, routingKey, id, excludes): self.src = Broker (srcBroker) mc = self.mclient @@ -138,6 +138,8 @@ class RouteManager: bridgeArgs["src"] = exchange bridgeArgs["dest"] = exchange bridgeArgs["key"] = routingKey + bridgeArgs["id"] = id + bridgeArgs["excludes"] = excludes bridgeArgs["src_is_queue"] = 0 bridgeArgs["src_is_local"] = 0 res = mc.syncCallMethod (self.mch, link.id, link.classKey, "bridge", bridgeArgs) @@ -253,11 +255,18 @@ if cmd != "load": rm = RouteManager (cargs[1]) rm.ConnectToBroker () -if cmd == "add" or cmd == "del": +if cmd == "add": + if nargs < 5 or nargs > 7: + Usage () + + id = "" + excludes = "" + if nargs > 5: id = cargs[5] + if nargs > 6: excludes = cargs[6] + rm.AddRoute (cargs[2], cargs[3], cargs[4], id, excludes) +elif cmd == "del": if nargs != 5: Usage () - if cmd == "add": - rm.AddRoute (cargs[2], cargs[3], cargs[4]) else: rm.DelRoute (cargs[2], cargs[3], cargs[4]) else: |