From 18ea7aaaaf32eb7027008196f2c784cd156fb5d9 Mon Sep 17 00:00:00 2001 From: Tim Rozet Date: Tue, 1 Sep 2015 16:41:28 -0400 Subject: [PATCH] Fixes issue with deploy copying from /tmp and clean bailing early 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 --- foreman/ci/clean.sh | 6 +++--- foreman/ci/deploy.sh | 3 +-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/foreman/ci/clean.sh b/foreman/ci/clean.sh index 1bd1713..345864b 100755 --- a/foreman/ci/clean.sh +++ b/foreman/ci/clean.sh @@ -128,7 +128,7 @@ if [ $skip_vagrant -eq 0 ]; then 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 @@ -158,13 +158,13 @@ if [ $skip_vagrant -eq 0 ]; then 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) - 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 diff --git a/foreman/ci/deploy.sh b/foreman/ci/deploy.sh index 9c1447b..50a9dcf 100755 --- a/foreman/ci/deploy.sh +++ b/foreman/ci/deploy.sh @@ -30,6 +30,7 @@ declare -A admin_ip_arr declare -A public_ip_arr vm_dir=/var/opt/opnfv +script=`realpath $0` ##END VARS ##FUNCTIONS @@ -479,7 +480,6 @@ clean_tmp() { ##params: destination directory ##usage: clone_bgs /tmp/myvm/ clone_bgs() { - script=`realpath $0` script_dir="`dirname "$script"`" cp -fr $script_dir/ $1 cp -fr $script_dir/../../common/puppet-opnfv $1 @@ -993,7 +993,6 @@ start_virtual_nodes() { compute_wait_completed=false for node in ${nodes}; do - cd /tmp/ ##remove VM nodes incase it wasn't cleaned up rm -rf $vm_dir/$node -- 2.16.6