summaryrefslogtreecommitdiff
path: root/tools/src
diff options
context:
space:
mode:
authorTed Ross <tross@apache.org>2013-03-13 18:34:58 +0000
committerTed Ross <tross@apache.org>2013-03-13 18:34:58 +0000
commitf685c194c28ecfbcdadd3ba2af2a5a2977ebf268 (patch)
treefdb3c1af92e6d5086cf1fa2b6f56cfa6b9f33142 /tools/src
parent1c0cc0cdef1bfd674955897deaff12a88cef4cbb (diff)
downloadqpid-python-f685c194c28ecfbcdadd3ba2af2a5a2977ebf268.tar.gz
QPID-4559 - Added handling of the queue-delete preconditions in the qmf broker method.
Patch contributed by Ernie Allen. git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@1456081 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'tools/src')
-rwxr-xr-xtools/src/py/qpid-config3
-rw-r--r--tools/src/py/qpidtoollibs/broker.py9
2 files changed, 9 insertions, 3 deletions
diff --git a/tools/src/py/qpid-config b/tools/src/py/qpid-config
index 2bab892c95..66567d0246 100755
--- a/tools/src/py/qpid-config
+++ b/tools/src/py/qpid-config
@@ -624,7 +624,8 @@ class BrokerManager:
if len(args) < 1:
Usage()
qname = args[0]
- self.broker.delQueue(qname)
+ self.broker.delQueue(qname, if_empty=config._if_empty, if_unused=config._if_unused)
+
def Bind(self, args):
diff --git a/tools/src/py/qpidtoollibs/broker.py b/tools/src/py/qpidtoollibs/broker.py
index ea31aeabb0..d8b75c3c60 100644
--- a/tools/src/py/qpidtoollibs/broker.py
+++ b/tools/src/py/qpidtoollibs/broker.py
@@ -250,8 +250,13 @@ class BrokerAgent(object):
'strict': True}
self._method('create', args)
- def delQueue(self, name):
- args = {'type': 'queue', 'name': name}
+ def delQueue(self, name, if_empty=True, if_unused=True):
+ options = {'if_empty': if_empty,
+ 'if_unused': if_unused}
+
+ args = {'type': 'queue',
+ 'name': name,
+ 'options': options}
self._method('delete', args)
def bind(self, exchange, queue, key, options={}, **kwargs):