Merge "Save stackenv values more often"

This commit is contained in:
Jenkins 2015-06-19 05:29:39 +00:00 committed by Gerrit Code Review
commit ee12f5f886
2 changed files with 27 additions and 6 deletions

View File

@ -43,6 +43,25 @@ declare -A GITDIR
TRACK_DEPENDS=${TRACK_DEPENDS:-False}
# Save these variables to .stackenv
STACK_ENV_VARS="BASE_SQL_CONN DATA_DIR DEST ENABLED_SERVICES HOST_IP \
KEYSTONE_AUTH_PROTOCOL KEYSTONE_AUTH_URI KEYSTONE_SERVICE_URI \
LOGFILE OS_CACERT SERVICE_HOST SERVICE_PROTOCOL STACK_USER TLS_IP"
# Saves significant environment variables to .stackenv for later use
# Refers to a lot of globals, only TOP_DIR and STACK_ENV_VARS are required to
# function, the rest are simply saved and do not cause problems if they are undefined.
# save_stackenv [tag]
function save_stackenv {
local tag=${1:-""}
# Save some values we generated for later use
time_stamp=$(date "+$TIMESTAMP_FORMAT")
echo "# $time_stamp $tag" >$TOP_DIR/.stackenv
for i in $STACK_ENV_VARS; do
echo $i=${!i} >>$TOP_DIR/.stackenv
done
}
# Normalize config values to True or False
# Accepts as False: 0 no No NO false False FALSE
@ -68,6 +87,7 @@ function isset {
[[ -v "$1" ]]
}
# Control Functions
# =================

View File

@ -669,6 +669,9 @@ if is_service_enabled s-proxy; then
fi
fi
# Save configuration values
save_stackenv $LINENO
# Install Packages
# ================
@ -950,6 +953,9 @@ fi
# Initialize the directory for service status check
init_service_check
# Save configuration values
save_stackenv $LINENO
# Start Services
# ==============
@ -1287,12 +1293,7 @@ fi
# Save some values we generated for later use
CURRENT_RUN_TIME=$(date "+$TIMESTAMP_FORMAT")
echo "# $CURRENT_RUN_TIME" >$TOP_DIR/.stackenv
for i in BASE_SQL_CONN ENABLED_SERVICES HOST_IP LOGFILE \
SERVICE_HOST SERVICE_PROTOCOL STACK_USER TLS_IP KEYSTONE_AUTH_PROTOCOL OS_CACERT; do
echo $i=${!i} >>$TOP_DIR/.stackenv
done
save_stackenv
# Write out a clouds.yaml file
# putting the location into a variable to allow for easier refactoring later