eventscripts: Fix regression in _loadconfig()
authorMartin Schwenke <martin@meltin.net>
Tue, 14 May 2013 04:56:26 +0000 (14:56 +1000)
committerAmitay Isaacs <amitay@gmail.com>
Wed, 22 May 2013 04:24:21 +0000 (14:24 +1000)
fff88940f71058e4eefd65f50a6701389c005c17 introduced a regression.
Without $service_name set by default, the CTDB configuration is no
longer loaded when loadconfig() is called without any arguments.
That's bad.

Signed-off-by: Martin Schwenke <martin@meltin.net>
config/functions

index 4f31d84080f6a18d3acfe021d47e6323e5eaf0b5..5778420f08a350e744c2e406579f40461e659573 100755 (executable)
@@ -23,11 +23,18 @@ _loadconfig() {
        foo="${service_config:-${service_name}}"
        if [ -n "$foo" ] ; then
            loadconfig "$foo"
+           return
        fi
-    elif [ "$1" != "ctdb" ] ; then
+    fi
+
+    if [ "$1" != "ctdb" ] ; then
        loadconfig "ctdb"
     fi
 
+    if [ -z "$1" ] ; then
+       return
+    fi
+
     if [ -f $CTDB_ETCDIR/sysconfig/$1 ]; then
        . $CTDB_ETCDIR/sysconfig/$1
     elif [ -f $CTDB_ETCDIR/default/$1 ]; then