# HG changeset patch
# User Florian Haas <[email protected]>
# Date 1287508607 -7200
# Node ID d7d0f2719155a521c23a1e0308cfffe2ad67c09b
# Parent 3f4c98a0c37915877baee2d970b8051f0a4cef7b
Low: ManageVE: clean up stop action
Invoke status before stop.
Use ocf_run.
diff -r 3f4c98a0c379 -r d7d0f2719155 heartbeat/ManageVE
--- a/heartbeat/ManageVE Tue Oct 19 19:10:27 2010 +0200
+++ b/heartbeat/ManageVE Tue Oct 19 19:16:47 2010 +0200
@@ -128,15 +128,13 @@
#
stop_ve()
{
- declare -i retcode
+ status_ve
+ if [ $? -eq $OCF_NOT_RUNNING ]; then
+ ocf_log info "VE $VEID already stopped."
+ return $OCF_SUCCESS
+ fi
- $VZCTL stop $VEID >& /dev/null
- retcode=$?
-
- if [[ $retcode != 0 ]]; then
- ocf_log err "vzctl stop $VEID returned: $retcode"
- exit $OCF_ERR_GENERIC
- fi
+ ocf_run $VZCTL stop $VEID || exit $OCF_ERR_GENERIC
return $OCF_SUCCESS
}
_______________________________________________________
Linux-HA-Dev: [email protected]
http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev
Home Page: http://linux-ha.org/