Improvements to uninstall script
- Kill only the specific heat processes we want (heat-api and heat-engine). - Remove installations wherever they may be located. - More robust handling of input. Signed-off-by: Zane Bitter <zbitter@redhat.com>
This commit is contained in:
parent
80302ceffd
commit
45702a0d26
@ -9,19 +9,23 @@ fi
|
|||||||
user_wants() {
|
user_wants() {
|
||||||
if [ "$SKIP_ASK" = "y" ]; then return 0; fi
|
if [ "$SKIP_ASK" = "y" ]; then return 0; fi
|
||||||
|
|
||||||
|
while true; do
|
||||||
read -n 1 -p "$1 " cont
|
read -n 1 -p "$1 " cont
|
||||||
echo 1>&2
|
echo 1>&2
|
||||||
case $cont in
|
case $cont in
|
||||||
y|Y)
|
y|Y)
|
||||||
return 0
|
return 0
|
||||||
;;
|
;;
|
||||||
*)
|
n|N)
|
||||||
return 1
|
return 1
|
||||||
;;
|
;;
|
||||||
|
*)
|
||||||
|
;;
|
||||||
esac
|
esac
|
||||||
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
HEAT_PIDS=`pgrep 'heat-.+'`
|
HEAT_PIDS=`pgrep '^heat-(api|engine)$'`
|
||||||
if [ -n "$HEAT_PIDS" ]; then
|
if [ -n "$HEAT_PIDS" ]; then
|
||||||
echo 'The following Heat processes are running:' 1>&2
|
echo 'The following Heat processes are running:' 1>&2
|
||||||
ps $HEAT_PIDS 1>&2
|
ps $HEAT_PIDS 1>&2
|
||||||
@ -41,7 +45,7 @@ if user_wants 'Erase OpenStack installation?'; then
|
|||||||
echo 1>&2
|
echo 1>&2
|
||||||
fi
|
fi
|
||||||
|
|
||||||
HEAT_EGGS=`find ${PYTHONHOME:-/usr/lib/python2.7}/site-packages/ -maxdepth 1 -type d -name 'heat-*.egg'`
|
HEAT_EGGS=`python -c 'import sys; print "\n".join(sys.path)' | grep '/heat-[^/]*\.egg$'`
|
||||||
if [ -n "$HEAT_EGGS" ]; then
|
if [ -n "$HEAT_EGGS" ]; then
|
||||||
echo 'The following Heat installations were found:' 1>&2
|
echo 'The following Heat installations were found:' 1>&2
|
||||||
echo "$HEAT_EGGS" 1>&2
|
echo "$HEAT_EGGS" 1>&2
|
||||||
|
Loading…
Reference in New Issue
Block a user