ctdb-eventscripts: Fix regression in IP add/delete functions
authorMartin Schwenke <martin@meltin.net>
Fri, 14 Mar 2014 02:14:18 +0000 (13:14 +1100)
committerAmitay Isaacs <amitay@samba.org>
Sun, 23 Mar 2014 03:20:14 +0000 (04:20 +0100)
Commit 176ae6c704528c021fcc34a41878584f43a00119 caused these functions
to exit on failure.  This is incorrect and broke NAT gateway.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
ctdb/config/functions

index 6efe60f0d3434201b46fd788c4ffcb3bcb4617c7..6bc03126299bc36ea831be7a2e9fc836b6ab0fdc 100755 (executable)
@@ -832,8 +832,10 @@ add_ip_to_iface ()
     ip link set "$_iface" up || \
        die "Failed to bringup interface $_iface"
 
-    ip addr add "$_ip/$_maskbits" brd + dev "$_iface" || \
-       die "Failed to add $_ip/$_maskbits on dev $_iface"
+    ip addr add "$_ip/$_maskbits" brd + dev "$_iface" || {
+       echo "Failed to add $_ip/$_maskbits on dev $_iface"
+       return 1
+    }
 }
 
 delete_ip_from_iface()
@@ -849,8 +851,10 @@ delete_ip_from_iface()
     # remembering and re-adding secondaries.
     set_proc "sys/net/ipv4/conf/${_iface}/promote_secondaries" 1
 
-    ip addr del "$_ip/$_maskbits" dev "$_iface" || \
-       die "Failed to del $_ip on dev $_iface"
+    ip addr del "$_ip/$_maskbits" dev "$_iface" || {
+       echo "Failed to del $_ip on dev $_iface"
+       return 1
+    }
 }
 
 # If the given IP is hosted then print 2 items: maskbits and iface