use `bash` to parse shell
[releng.git] / jjb / doctor / doctor-env-presetup.sh
index 8c7c12e..ebbf32c 100755 (executable)
@@ -42,6 +42,13 @@ elif [[ ${INSTALLER_TYPE} == 'daisy' ]]; then
         echo "No available installer VM exists...exiting"
         exit 1
     fi
+
+elif [[ ${INSTALLER_TYPE} == 'fuel' ]]; then
+    if [[ ! "${BRANCH}" =~ "danube" ]]; then
+        export SSH_KEY=${SSH_KEY:-/var/lib/opnfv/mcp.rsa}
+        sudo cp ${SSH_KEY} ${installer_key_file}
+        sudo chown `whoami`:`whoami` ${installer_key_file}
+    fi
 fi
 
 
@@ -57,4 +64,6 @@ fi
 # Write the installer info to the file
 echo export INSTALLER_TYPE=${INSTALLER_TYPE} > $opnfv_installer
 echo export INSTALLER_IP=${INSTALLER_IP} >> $opnfv_installer
-echo export SSH_KEY=${installer_key_file} >> $opnfv_installer
+if [ -e ${installer_key_file} ]; then
+    echo export SSH_KEY=${installer_key_file} >> $opnfv_installer
+fi