Fix the value of NETWORK_PRIVATE_PREFIX when there are options
authorMartin Schwenke <martin@meltin.net>
Wed, 18 Jun 2014 03:06:36 +0000 (13:06 +1000)
committerMartin Schwenke <martin@meltin.net>
Wed, 25 Jun 2014 10:46:16 +0000 (20:46 +1000)
The current calculation is incorrect when the private network has
options.  This causes broken hosts and CTDB nodes files.

Signed-off-by: Martin Schwenke <martin@meltin.net>
config.d/00base.defconf

index 37748cc76f68f57bbebf352aaecc69a04eb6eb98..f0450739e5ace3a0ca43b21722dcf9106fda0a0f 100644 (file)
@@ -276,7 +276,8 @@ networks_post_config_hook ()
     # Convenience variables
     set -- $NETWORKS
     NETWORK_PRIVATE="$1" ; shift
-    NETWORK_PRIVATE_PREFIX="${NETWORK_PRIVATE%.*}"
+    local t="${NETWORK_PRIVATE%%,*}"
+    NETWORK_PRIVATE_PREFIX="${t%.*}"
     NETWORKS_PUBLIC="$*"
 }