deploy.sh was failing in user deployments because the necessary puppet
modules and vagrant files were being copied accidentally from /tmp and
not the script directory. This patch fixes that issue. clean.sh was
failing checks to see if vagrant or virtualbox was still running, due to
a bug with checking "ps" and using grep. This patch resolves that.
JIRA: APEX-16,APEX-17
Change-Id: I1faa6fc134c0308acb2e7b14be30f7cd3c99d109
Signed-off-by: Tim Rozet <trozet@redhat.com>
echo "${red}Unable to destroy $vm Vagrant VM! Attempting to killall vagrant if process is hung ${reset}"
killall vagrant
echo "${blue}Checking if vagrant was already destroyed and no process is active...${reset}"
echo "${red}Unable to destroy $vm Vagrant VM! Attempting to killall vagrant if process is hung ${reset}"
killall vagrant
echo "${blue}Checking if vagrant was already destroyed and no process is active...${reset}"
- if ps axf | grep vagrant; then
+ if ps axf | grep vagrant | grep -v 'grep'; then
echo "${red}Vagrant process still exists after kill...exiting ${reset}"
exit 1
else
echo "${red}Vagrant process still exists after kill...exiting ${reset}"
exit 1
else
echo "${blue}Checking for any remaining virtual box processes...${reset}"
###kill virtualbox
echo "${blue}Checking for any remaining virtual box processes...${reset}"
###kill virtualbox
- if ps axf | grep virtualbox; then
+ if ps axf | grep virtualbox | grep -v 'grep'; then
echo "${blue}virtualbox processes are still running. Killing any remaining VirtualBox processes...${reset}"
killall virtualbox
fi
###kill any leftover VMs (brute force)
echo "${blue}virtualbox processes are still running. Killing any remaining VirtualBox processes...${reset}"
killall virtualbox
fi
###kill any leftover VMs (brute force)
- if ps axf | grep VBoxHeadless; then
+ if ps axf | grep VBoxHeadless | grep -v 'grep'; then
echo "${blue}VBoxHeadless processes are still running. Killing any remaining VBoxHeadless processes...${reset}"
killall VBoxHeadless
fi
echo "${blue}VBoxHeadless processes are still running. Killing any remaining VBoxHeadless processes...${reset}"
killall VBoxHeadless
fi
declare -A public_ip_arr
vm_dir=/var/opt/opnfv
declare -A public_ip_arr
vm_dir=/var/opt/opnfv
##params: destination directory
##usage: clone_bgs /tmp/myvm/
clone_bgs() {
##params: destination directory
##usage: clone_bgs /tmp/myvm/
clone_bgs() {
script_dir="`dirname "$script"`"
cp -fr $script_dir/ $1
cp -fr $script_dir/../../common/puppet-opnfv $1
script_dir="`dirname "$script"`"
cp -fr $script_dir/ $1
cp -fr $script_dir/../../common/puppet-opnfv $1
compute_wait_completed=false
for node in ${nodes}; do
compute_wait_completed=false
for node in ${nodes}; do
##remove VM nodes incase it wasn't cleaned up
rm -rf $vm_dir/$node
##remove VM nodes incase it wasn't cleaned up
rm -rf $vm_dir/$node