summaryrefslogtreecommitdiff
path: root/qpid
diff options
context:
space:
mode:
authorPavel Moravec <pmoravec@apache.org>2014-07-30 08:02:43 +0000
committerPavel Moravec <pmoravec@apache.org>2014-07-30 08:02:43 +0000
commitc6e3b231d55310521ce4b1877e925732f95b0df1 (patch)
treeba6288cbd90511438a88232c5ca93d34777c46e6 /qpid
parent6025a327cf5b9007354fbf1f71e0d6a7fa1f478b (diff)
downloadqpid-python-c6e3b231d55310521ce4b1877e925732f95b0df1.tar.gz
[QPID-5938]: qpid-stat: remove dead code relevant to active-active cluster
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1614577 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid')
-rwxr-xr-xqpid/tools/src/py/qpid-stat61
1 files changed, 0 insertions, 61 deletions
diff --git a/qpid/tools/src/py/qpid-stat b/qpid/tools/src/py/qpid-stat
index d3c2820743..d31dc9343d 100755
--- a/qpid/tools/src/py/qpid-stat
+++ b/qpid/tools/src/py/qpid-stat
@@ -116,31 +116,6 @@ def OptionsAndArguments(argv):
return args
-class IpAddr:
- def __init__(self, text):
- if text.find("@") != -1:
- tokens = text.split("@")
- text = tokens[1]
- if text.find(":") != -1:
- tokens = text.split(":")
- text = tokens[0]
- self.port = int(tokens[1])
- else:
- self.port = 5672
- self.dottedQuad = socket.gethostbyname(text)
- nums = self.dottedQuad.split(".")
- self.addr = (int(nums[0]) << 24) + (int(nums[1]) << 16) + (int(nums[2]) << 8) + int(nums[3])
-
- def bestAddr(self, addrPortList):
- bestDiff = 0xFFFFFFFFL
- bestAddr = None
- for addrPort in addrPortList:
- diff = IpAddr(addrPort[0]).addr ^ self.addr
- if diff < bestDiff:
- bestDiff = diff
- bestAddr = addrPort
- return bestAddr
-
class BrokerManager:
def __init__(self):
self.brokerName = None
@@ -162,42 +137,6 @@ class BrokerManager:
except:
pass
- def _getCluster(self):
- packages = self.qmf.getPackages()
- if "org.apache.qpid.cluster" not in packages:
- return None
-
- clusters = self.qmf.getObjects(_class="cluster", _agent=self.brokerAgent)
- if len(clusters) == 0:
- print "Clustering is installed but not enabled on the broker."
- return None
-
- self.cluster = clusters[0]
-
- def _getHostList(self, urlList):
- hosts = []
- hostAddr = IpAddr(config._host)
- for url in urlList:
- if url.find("amqp:") != 0:
- raise Exception("Invalid URL 1")
- url = url[5:]
- addrs = str(url).split(",")
- addrList = []
- for addr in addrs:
- tokens = addr.split(":")
- if len(tokens) != 3:
- raise Exception("Invalid URL 2")
- addrList.append((tokens[1], tokens[2]))
-
- # Find the address in the list that is most likely to be in the same subnet as the address
- # with which we made the original QMF connection. This increases the probability that we will
- # be able to reach the cluster member.
-
- best = hostAddr.bestAddr(addrList)
- bestUrl = best[0] + ":" + best[1]
- hosts.append(bestUrl)
- return hosts
-
def displayBroker(self):
disp = Display(prefix=" ")
heads = []