Repository: qpid-cpp
Updated Branches:
  refs/heads/master f676974d0 -> 55d4171a8


QPID-7876 qpid-route does not properly consider src-local when matching bridges


Project: http://git-wip-us.apache.org/repos/asf/qpid-cpp/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-cpp/commit/55d4171a
Tree: http://git-wip-us.apache.org/repos/asf/qpid-cpp/tree/55d4171a
Diff: http://git-wip-us.apache.org/repos/asf/qpid-cpp/diff/55d4171a

Branch: refs/heads/master
Commit: 55d4171a8155d9f6a07a48507e33d43b8cb6d904
Parents: f676974
Author: Chris Richardson <chris.richard...@fourc.eu>
Authored: Fri Aug 4 15:16:57 2017 +0100
Committer: Gordon Sim <g...@redhat.com>
Committed: Fri Aug 4 17:10:25 2017 +0100

----------------------------------------------------------------------
 management/python/bin/qpid-route | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-cpp/blob/55d4171a/management/python/bin/qpid-route
----------------------------------------------------------------------
diff --git a/management/python/bin/qpid-route b/management/python/bin/qpid-route
index fc94dfe..214fd45 100755
--- a/management/python/bin/qpid-route
+++ b/management/python/bin/qpid-route
@@ -344,7 +344,7 @@ class RouteManager:
         for bridge in bridges:
             if bridge.linkRef == link.getObjectId() and \
                     bridge.dest == dest and bridge.src == src and 
bridge.srcIsQueue == srcIsQueue and \
-                    bridge.srcIsLocal == srcIsLocal and bridge.dynamic == 
dynamic:
+                    bridge.key == key and bridge.srcIsLocal == srcIsLocal and 
bridge.dynamic == dynamic:
                 if not config._quiet:
                     raise Exception("Duplicate Route - ignoring: %s(%s)" % 
(dest, key or src))
                 sys.exit(0)
@@ -352,11 +352,13 @@ class RouteManager:
         if config._verbose:
             print "Creating inter-broker binding..."
 
-        name = "%s:%s:%s:%s" % (dest, key or src, srcIsQueue, srcIsLocal)
+        linkName = self.getLinkName(link)
+        # Don't put <linkName> first in the bridge name as the "qpid." prefix 
will be rejected by the broker
+        name = "%s:%s:%s:%s:%s" % (dest, key or src, linkName, srcIsQueue, 
srcIsLocal)
 
         brokers = self.agent.getObjects(_class="broker")
         broker = brokers[0]
-        properties = {"link" : self.getLinkName(link),
+        properties = {"link" : linkName,
                       "src"  : src,
                       "dest" : dest,
                       "key"  : key,
@@ -368,7 +370,8 @@ class RouteManager:
                       "dynamic"    : dynamic,
                       "sync"       : sync,
                       "credit"     : credit }
-        # Broker also decodes "queue" but this may be a mistake...? It's not a 
Bridge property in the QMF schema.
+        # Broker also decodes "queue", which is used by the bridge instead of 
creating a new one. However it is not a
+        # Bridge property in the QMF schema so is omitted here.
 
         res = broker.create("bridge", name, properties, False)
         if res.status != 0:
@@ -435,7 +438,7 @@ class RouteManager:
         bridges = self.agent.getObjects(_class="bridge")
         for bridge in bridges:
             if bridge.linkRef == link.getObjectId() and bridge.dest == 
exchange and bridge.key == routingKey \
-                    and bridge.dynamic == dynamic and bridge.srcIsLocal == 
config._srclocal:
+                    and not bridge.srcIsQueue and bridge.dynamic == dynamic 
and bridge.srcIsLocal == config._srclocal:
                 if config._verbose:
                     print "Closing bridge..."
                 res = bridge.close()


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@qpid.apache.org
For additional commands, e-mail: commits-h...@qpid.apache.org

Reply via email to