summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDeepti Kulkarni <deepti@vyatta.com>2011-07-27 09:18:10 -0700
committerDeepti Kulkarni <deepti@vyatta.com>2011-07-27 09:18:10 -0700
commit7cf70906a16321884a88aa4dc5cfb064f10a85f9 (patch)
treeda063f8fdae4972c0cf42d478b2e9caf858b89a2
parent45cd85259ba7605ab8140ba615dc382eba3a8aba (diff)
downloadvyatta-cluster-7cf70906a16321884a88aa4dc5cfb064f10a85f9.tar.gz
vyatta-cluster-7cf70906a16321884a88aa4dc5cfb064f10a85f9.zip
Added missing validation for force cluster standby command.
-rw-r--r--templates-op/force/cluster/active/node.def4
-rw-r--r--templates-op/force/cluster/standby/node.def10
2 files changed, 10 insertions, 4 deletions
diff --git a/templates-op/force/cluster/active/node.def b/templates-op/force/cluster/active/node.def
index d610277..fc91fc7 100644
--- a/templates-op/force/cluster/active/node.def
+++ b/templates-op/force/cluster/active/node.def
@@ -8,7 +8,7 @@ run: local -a grp ;
echo "Warning: Auto-failback is configured."
fi
sudo /usr/share/heartbeat/hb_takeover >&/dev/null
- echo "Requesting to take over cluster resources."
+ echo "Requesting to take over cluster resources"
else
- echo "Clustering is not configured."
+ echo "Clustering is not configured"
fi
diff --git a/templates-op/force/cluster/standby/node.def b/templates-op/force/cluster/standby/node.def
index 3490960..f60816c 100644
--- a/templates-op/force/cluster/standby/node.def
+++ b/templates-op/force/cluster/standby/node.def
@@ -1,3 +1,9 @@
help: Release cluster resources and allow a remote to become master
-run: sudo /usr/share/heartbeat/hb_standby >&/dev/null
- echo "Attempting to release cluster resources."
+run: local -a grp ;
+ eval "grp=($(cli-shell-api listActiveNodes cluster group))"
+ if [ -n "$grp" ]; then
+ sudo /usr/share/heartbeat/hb_standby >&/dev/null
+ echo "Attempting to release cluster resources"
+ else
+ echo "Clustering is not configured"
+ fi