summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xqpid/tools/src/py/qpid-config18
1 files changed, 16 insertions, 2 deletions
diff --git a/qpid/tools/src/py/qpid-config b/qpid/tools/src/py/qpid-config
index 3430eb6469..63fe66da67 100755
--- a/qpid/tools/src/py/qpid-config
+++ b/qpid/tools/src/py/qpid-config
@@ -102,6 +102,7 @@ class Config:
self._flowStopSize = None
self._flowResumeSize = None
self._extra_arguments = []
+ self._returnCode = 0
config = Config()
@@ -359,9 +360,16 @@ class BrokerManager:
caption1 = "Type "
caption2 = "Exchange Name"
maxNameLen = len(caption2)
+ found = False
for ex in exchanges:
if self.match(ex.name, filter):
if len(ex.name) > maxNameLen: maxNameLen = len(ex.name)
+ found = True
+ if not found:
+ global config
+ config._returnCode = 1
+ return
+
print "%s%-*s Attributes" % (caption1, maxNameLen, caption2)
line = ""
for i in range(((maxNameLen + len(caption1)) / 5) + 5):
@@ -398,12 +406,18 @@ class BrokerManager:
def QueueList(self, filter):
queues = self.qmf.getObjects(_class="queue", _agent=self.brokerAgent)
-
caption = "Queue Name"
maxNameLen = len(caption)
+ found = False
for q in queues:
if self.match(q.name, filter):
if len(q.name) > maxNameLen: maxNameLen = len(q.name)
+ found = True
+ if not found:
+ global config
+ config._returnCode = 1
+ return
+
print "%-*s Attributes" % (maxNameLen, caption)
line = ""
for i in range((maxNameLen / 5) + 5):
@@ -675,7 +689,7 @@ def main(argv=None):
print "Failed: %s: %s" % (e.__class__.__name__, e)
return 1
- return 0
+ return config._returnCode
if __name__ == "__main__":
sys.exit(main())