diff options
| author | Alan Conway <aconway@apache.org> | 2013-02-25 20:08:15 +0000 |
|---|---|---|
| committer | Alan Conway <aconway@apache.org> | 2013-02-25 20:08:15 +0000 |
| commit | c1387aa47ec51604fa8664ebe4af370f7a6b67e3 (patch) | |
| tree | 6864b75256d43be86f526bff2b1e820881a8d3cf /tools | |
| parent | 3c09b0a8be811f899a57d62f26ab6bde3631b87f (diff) | |
| download | qpid-python-c1387aa47ec51604fa8664ebe4af370f7a6b67e3.tar.gz | |
QPID-4600: New HA regularly shutting down active node
qpid-primary script was incorrect and failing on status calls,
causing the broker to be restarted by rgmanager.
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@1449870 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'tools')
| -rwxr-xr-x | tools/src/py/qpid-ha | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/tools/src/py/qpid-ha b/tools/src/py/qpid-ha index 4414623855..3d56f24fb8 100755 --- a/tools/src/py/qpid-ha +++ b/tools/src/py/qpid-ha @@ -88,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: |
