Merge "Change check on host_evacuation"

This commit is contained in:
Jenkins 2016-05-13 12:53:27 +00:00 committed by Gerrit Code Review
commit 610b2479c3
1 changed files with 6 additions and 8 deletions

View File

@ -11,14 +11,12 @@ fi
nova service-list --host $1
nova service-list | grep -q 'nova-compute.*enabled' && {
nova service-disable $1 nova-compute
}
nova service-list | grep -q 'nova-compute.*enabled' || {
echo "All nova-compute are disabled"
exit 3
}
if [ $(nova service-list | grep -c 'nova-compute.*enabled') -gt 1 ]; then
nova service-disable $1 nova-compute
else
echo "You can't disable last compute node"
exit 3
fi
while :; do
VMS=$(nova list --host $1 | grep -i ' active ' | wc -l)