From 09a3e715ec708a214eef1bed9aef01a593f96673 Mon Sep 17 00:00:00 2001 From: Ihar Hrachyshka Date: Wed, 13 Jan 2016 11:35:12 +0100 Subject: [PATCH] Create LOGDIR earlier in the process Specifically, before _install_epel_and_rdo is called, that may need to log an error. Change-Id: I4979eb9530e6ea366c99d168587b87ea358dc908 --- stack.sh | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/stack.sh b/stack.sh index 5e4a4f8310..21a805170f 100755 --- a/stack.sh +++ b/stack.sh @@ -297,16 +297,6 @@ EOF fi } -# If you have all the repos installed above already setup (e.g. a CI -# situation where they are on your image) you may choose to skip this -# to speed things up -SKIP_EPEL_INSTALL=$(trueorfalse False SKIP_EPEL_INSTALL) - -if is_fedora && [[ $DISTRO == "rhel7" ]] && \ - [[ ${SKIP_EPEL_INSTALL} != True ]]; then - _install_epel_and_rdo -fi - # Configure Target Directories # ---------------------------- @@ -320,6 +310,11 @@ sudo mkdir -p $DEST safe_chown -R $STACK_USER $DEST safe_chmod 0755 $DEST +# Destination path for devstack logs +if [[ -n ${LOGDIR:-} ]]; then + mkdir -p $LOGDIR +fi + # Destination path for service data DATA_DIR=${DATA_DIR:-${DEST}/data} sudo mkdir -p $DATA_DIR @@ -333,6 +328,16 @@ if [ -z "`grep ^127.0.0.1 /etc/hosts | grep $LOCAL_HOSTNAME`" ]; then sudo sed -i "s/\(^127.0.0.1.*\)/\1 $LOCAL_HOSTNAME/" /etc/hosts fi +# If you have all the repos installed above already setup (e.g. a CI +# situation where they are on your image) you may choose to skip this +# to speed things up +SKIP_EPEL_INSTALL=$(trueorfalse False SKIP_EPEL_INSTALL) + +if is_fedora && [[ $DISTRO == "rhel7" ]] && \ + [[ ${SKIP_EPEL_INSTALL} != True ]]; then + _install_epel_and_rdo +fi + # Ensure python is installed # -------------------------- is_package_installed python || install_package python @@ -392,10 +397,6 @@ TIMESTAMP_FORMAT=${TIMESTAMP_FORMAT:-"%F-%H%M%S"} LOGDAYS=${LOGDAYS:-7} CURRENT_LOG_TIME=$(date "+$TIMESTAMP_FORMAT") -if [[ -n ${LOGDIR:-} ]]; then - mkdir -p $LOGDIR -fi - if [[ -n "$LOGFILE" ]]; then # Clean up old log files. Append '.*' to the user-specified # ``LOGFILE`` to match the date in the search template.