summaryrefslogtreecommitdiff
path: root/tools/src/py/qpid-ha
diff options
context:
space:
mode:
authorKim van der Riet <kpvdr@apache.org>2013-02-28 16:14:30 +0000
committerKim van der Riet <kpvdr@apache.org>2013-02-28 16:14:30 +0000
commit9c73ef7a5ac10acd6a50d5d52bd721fc2faa5919 (patch)
tree2a890e1df09e5b896a9b4168a7b22648f559a1f2 /tools/src/py/qpid-ha
parent172d9b2a16cfb817bbe632d050acba7e31401cd2 (diff)
downloadqpid-python-asyncstore.tar.gz
Update from trunk r1375509 through r1450773asyncstore
git-svn-id: https://svn.apache.org/repos/asf/qpid/branches/asyncstore@1451244 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'tools/src/py/qpid-ha')
-rwxr-xr-xtools/src/py/qpid-ha11
1 files changed, 9 insertions, 2 deletions
diff --git a/tools/src/py/qpid-ha b/tools/src/py/qpid-ha
index 5b701a1fb4..3d56f24fb8 100755
--- a/tools/src/py/qpid-ha
+++ b/tools/src/py/qpid-ha
@@ -61,7 +61,9 @@ class Command:
if opts.ssl_certificate:
conn_options['ssl_certfile'] = opts.ssl_certificate
if opts.ssl_key:
- conn_options['ssl_key'] = opts.ssl_key
+ if not opts.ssl_certificate:
+ self.op.error("missing '--ssl-certificate' (required by '--ssl-key')")
+ conn_options['ssl_keyfile'] = opts.ssl_key
conn_options['client_properties'] = {'qpid.ha-admin' : 1}
connection = Connection.establish(opts.broker, **conn_options)
@@ -86,8 +88,13 @@ class StatusCmd(Command):
Command.__init__(self, "status", "Print HA status")
self.op.add_option(
"--expect", type="string", metavar="<status>",
- help="Don't print status but return 0 if it matches <status>, 1 otherwise")
+ help="Don't print status. Return 0 if it matches <status>, 1 otherwise")
+ self.op.add_option(
+ "--is-primary", action="store_true", default=False,
+ help="Don't print status. Return 0 if the broker is primary, 1 otherwise")
def do_execute(self, qmf_broker, ha_broker, opts, args):
+ if opts.is_primary:
+ if not ha_broker.status in ["active", "recovering"]: raise ExitStatus(1)
if opts.expect:
if opts.expect != ha_broker.status: raise ExitStatus(1)
else: