summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorxudan <xudan16@huawei.com>2018-10-14 21:55:44 -0400
committerxudan <xudan16@huawei.com>2018-10-14 21:55:44 -0400
commit8ca0b630db9e5c229663be2fbd4550bfee35f719 (patch)
tree467fd94f8dfa54efc7e1087489f698f909b866d0
parent0028e2f29f979fbda078b81bda0369a7b3262179 (diff)
[dovetail] Bugfix: incorrectly exit when file doesn't exist
When checking files, it shouldn't exit when getting an non-zero results. However, the scripts set -e at the begining. In order to continue the following steps when the file doesn't exists, replace all "return 0" or "return 1" to be "echo 0/1". Change-Id: I28ea81d52182d4dc5db56d47abbfbc1761f17d81 Signed-off-by: xudan <xudan16@huawei.com>
-rwxr-xr-xjjb/dovetail/dovetail-run.sh16
1 files changed, 8 insertions, 8 deletions
diff --git a/jjb/dovetail/dovetail-run.sh b/jjb/dovetail/dovetail-run.sh
index 5fe3d36bb..95b5e215e 100755
--- a/jjb/dovetail/dovetail-run.sh
+++ b/jjb/dovetail/dovetail-run.sh
@@ -36,9 +36,9 @@ sshkey=""
check_file_exists() {
if [[ -f $1 ]]; then
- return 0
+ echo 0
else
- return 1
+ echo 1
fi
}
@@ -91,8 +91,8 @@ get_joid_cred_file() {
}
change_cred_file_cacert_path() {
- check_file_exists ${CACERT}
- if [[ $? == 0 ]]; then
+ exists=`check_file_exists ${CACERT}`
+ if [[ $exists == 0 ]]; then
echo "INFO: set ${INSTALLER_TYPE} openstack cacert file to be ${CACERT}"
if [[ ${INSTALLER_TYPE} == "compass" ]]; then
echo "export OS_CACERT=${CACERT}" >> ${OPENRC}
@@ -107,8 +107,8 @@ change_cred_file_cacert_path() {
}
change_cred_file_ext_net() {
- check_file_exists ${OPENRC}
- if [[ $? == 0 ]]; then
+ exists=`check_file_exists ${OPENRC}`
+ if [[ $exists == 0 ]]; then
echo "export EXTERNAL_NETWORK=${EXTERNAL_NETWORK}" >> ${OPENRC}
else
echo "ERROR: cannot find file $OPENRC. Please check if it is existing."
@@ -128,8 +128,8 @@ get_cred_file() {
get_joid_cred_file
fi
- check_file_exists ${OPENRC}
- if [[ $? == 0 ]]; then
+ exists=`check_file_exists ${OPENRC}`
+ if [[ $exists == 0 ]]; then
echo "INFO: original openstack credentials file is"
cat $OPENRC
echo "INFO: change cacert file path in credentials file"