From 4f1058a3c12511a3c46a315791bc303e6a7d9ab9 Mon Sep 17 00:00:00 2001 From: Kristen Carlson Accardi Date: Mon, 10 Oct 2016 12:33:52 -0700 Subject: [PATCH] single-vm: move creation of ciao_bin directory Don't duplicate the mkdir of the ciao_bin directory, and instead move the call to make the directory to the top of the script. Signed-off-by: Kristen Carlson Accardi --- testutil/singlevm/setup.sh | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/testutil/singlevm/setup.sh b/testutil/singlevm/setup.sh index f0f93074c..84d043845 100755 --- a/testutil/singlevm/setup.sh +++ b/testutil/singlevm/setup.sh @@ -19,9 +19,16 @@ fedora_cloud_url="https://download.fedoraproject.org/pub/fedora/linux/releases/2 download=0 hosts_file_backup="/etc/hosts.orig.$RANDOM" -#Ensure that the local cache exists +#Create a directory where all the certificates, binaries and other +#dependencies are placed mkdir -p "$ciao_bin" +if [ ! -d "$ciao_bin" ] +then + echo "FATAL ERROR: Unable to create $ciao_bin" + exit 1 +fi + # Copy the cleanup scripts cp "$ciao_scripts"/cleanup.sh "$ciao_bin" @@ -94,16 +101,6 @@ echo "$ciao_ip $ciao_host" > hosts sudo mv hosts /etc/hosts sudo rm -rf /var/lib/ciao/instances -#Create a directory where all the certificates, binaries and other -#dependencies are placed -mkdir "$ciao_bin" - -if [ ! -d "$ciao_bin" ] -then - echo "FATAL ERROR: Unable to create $ciao_bin" - exit 1 -fi - cd "$ciao_bin" #Cleanup any old artifcats