eventscripts: Simplify handling of $service name in "managed" functions
authorMartin Schwenke <martin@meltin.net>
Mon, 29 Apr 2013 17:32:29 +0000 (03:32 +1000)
committerAmitay Isaacs <amitay@gmail.com>
Mon, 6 May 2013 05:45:10 +0000 (15:45 +1000)
commite9abc9c070368a81771a541701b03f75da1c5352
treeef3bfdec6b20da2f05b5cd11d98be03492646b79
parentc56acf71277dc269f17c239acab7a46c982dea51
eventscripts: Simplify handling of $service name in "managed" functions

Complicated argument handling was introduced to deal with multiple
services per eventscript.  This was a failure and we split 50.samba.

This simplifies several functions to use global $service_name
unconditionally instead of having an optional argument.

$service_name is no automatically longer set in the functions file.
This means it needs to be explicitly set in 13.per_ip_routing because
this script uses ctdb_service_check_reconfigure().

Eventscript unit test infrastructure needs to set $service_name during
fake service setup, and policy routing tests need to be updated
accordingly.

Signed-off-by: Martin Schwenke <martin@meltin.net>
(This used to be ctdb commit 27aab8783898a50da8c4bc887b512d8f0c0d842c)
ctdb/config/events.d/13.per_ip_routing
ctdb/config/functions
ctdb/tests/eventscripts/13.per_ip_routing.016.sh
ctdb/tests/eventscripts/13.per_ip_routing.017.sh
ctdb/tests/eventscripts/13.per_ip_routing.018.sh
ctdb/tests/eventscripts/13.per_ip_routing.019.sh
ctdb/tests/eventscripts/scripts/local.sh