From f685c194c28ecfbcdadd3ba2af2a5a2977ebf268 Mon Sep 17 00:00:00 2001 From: Ted Ross Date: Wed, 13 Mar 2013 18:34:58 +0000 Subject: 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 --- tools/src/py/qpid-config | 3 ++- tools/src/py/qpidtoollibs/broker.py | 9 +++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) (limited to 'tools/src') 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): -- cgit v1.2.1