ctdb-eventscripts: CTDB_NATGW_PUBLIC_* optional on slave-only nodes
authorMartin Schwenke <martin@meltin.net>
Thu, 10 Apr 2014 01:58:57 +0000 (11:58 +1000)
committerMartin Schwenke <martins@samba.org>
Mon, 14 Apr 2014 04:06:49 +0000 (06:06 +0200)
commit2f2421bae1a8ff46ad54f76d02e6dd1c3ffe3300
treeb30e1aaf874c27de108ae8979172244972e16fd4
parentce8ac88b969bb8bb7a94e62bb6e86aec389be6ac
ctdb-eventscripts: CTDB_NATGW_PUBLIC_* optional on slave-only nodes

Commit 4ee4925d416a86341bd76c11fa99ec9173682a1d forgot about
CTDB_NATGW_SLAVE_ONLY so it introduces an incorrect failure when this
is set, and CTDB_NATGW_PUBLIC_IFACE or CTDB_NATGW_PUBLIC_IP is unset.

Relax the sanity check to see if CTDB_NATGW_SLAVE_ONLY is set.

Update the documentation to explicitly state that
CTDB_NATGW_PUBLIC_IFACE and CTDB_NATGW_PUBLIC_IP are optional and
unused if CTDB_NATGW_SLAVE_ONLY is set.  It would be possible to
insist that CTDB_NATGW_PUBLIC_IFACE and CTDB_NATGW_PUBLIC_IFACE should
be unset in that case.  However, it is more reasonable to allow
consistent configuration across nodes except with some nodes
configured slave-only.

Add tests, update infrastructure and fix a thinko in the stub's
"natgwlist" implementation.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
Autobuild-User(master): Martin Schwenke <martins@samba.org>
Autobuild-Date(master): Mon Apr 14 06:06:49 CEST 2014 on sn-devel-104
ctdb/config/events.d/11.natgw
ctdb/doc/ctdbd.conf.5.xml
ctdb/tests/eventscripts/11.natgw.003.sh [new file with mode: 0755]
ctdb/tests/eventscripts/11.natgw.004.sh [new file with mode: 0755]
ctdb/tests/eventscripts/11.natgw.005.sh [new file with mode: 0755]
ctdb/tests/eventscripts/11.natgw.041.sh [new file with mode: 0755]
ctdb/tests/eventscripts/11.natgw.042.sh [new file with mode: 0755]
ctdb/tests/eventscripts/scripts/local.sh
ctdb/tests/eventscripts/stubs/ctdb