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)
commit27aab8783898a50da8c4bc887b512d8f0c0d842c
tree1dc7d6a467e8c4e83e06fc3311fe5de7e3761e39
parentb5802c4735e1c719a5cf9ce69489d5947bd5e8c5
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>
config/events.d/13.per_ip_routing
config/functions
tests/eventscripts/13.per_ip_routing.016.sh
tests/eventscripts/13.per_ip_routing.017.sh
tests/eventscripts/13.per_ip_routing.018.sh
tests/eventscripts/13.per_ip_routing.019.sh
tests/eventscripts/scripts/local.sh