summaryrefslogtreecommitdiff
path: root/tools/src
diff options
context:
space:
mode:
authorAlan Conway <aconway@apache.org>2014-09-26 15:38:02 +0000
committerAlan Conway <aconway@apache.org>2014-09-26 15:38:02 +0000
commitf6589e927a1c23fa56290d10180db055d6b97cfe (patch)
tree769a78d6446fa09f1dfd8769abcdabec6f88d80e /tools/src
parent800c8d3e93dfd957a86455858075cf46d5f06a46 (diff)
downloadqpid-python-f6589e927a1c23fa56290d10180db055d6b97cfe.tar.gz
QPID-6118: Add qmf shutdown command to the broker
QMF shutdown command implemented on broker. - ACL to control shutdown: acl deny all access method name=shutdown - Added "qpid-config shutdown" command to shut down the broker. git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@1627811 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'tools/src')
-rwxr-xr-xtools/src/py/qpid-config14
1 files changed, 10 insertions, 4 deletions
diff --git a/tools/src/py/qpid-config b/tools/src/py/qpid-config
index 3fc27ab241..ac93954484 100755
--- a/tools/src/py/qpid-config
+++ b/tools/src/py/qpid-config
@@ -28,7 +28,7 @@ import locale
home = os.environ.get("QPID_TOOLS_HOME", os.path.normpath("/usr/share/qpid-tools"))
sys.path.append(os.path.join(home, "python"))
-from qpid.messaging import Connection
+from qpid.messaging import Connection, ConnectionError
from qpidtoollibs import BrokerAgent
from qpidtoollibs import Display, Header
@@ -47,7 +47,8 @@ Usage: qpid-config [OPTIONS]
qpid-config [OPTIONS] reload-acl
qpid-config [OPTIONS] add <type> <name> [--argument <property-name>=<property-value>]
qpid-config [OPTIONS] del <type> <name>
- qpid-config [OPTIONS] list <type> [--show-property <property-name>]"""
+ qpid-config [OPTIONS] list <type> [--show-property <property-name>]
+ qpid-config [OPTIONS] shutdown"""
description = """
Examples:
@@ -813,7 +814,12 @@ def main(argv=None):
headers = [Header(a) for a in desired]
rows = [tuple([_clean_ref(o.get(a, "n/a")) for a in desired]) for o in objects]
display.formattedTable("Objects of type '%s'" % modifier, headers, rows)
-
+ elif cmd == "shutdown":
+ try:
+ bm.broker._method("shutdown", {})
+ except ConnectionError:
+ pass # Normal, the broker has been shut down!
+ bm.conn = None # Don't try to close again
else:
Usage()
except KeyboardInterrupt:
@@ -846,5 +852,5 @@ def main(argv=None):
if __name__ == "__main__":
- sys.exit(main())
+ sys.exit(main())