Create LOGDIR earlier in the process

Specifically, before _install_epel_and_rdo is called, that may need to log an
error.

Change-Id: I4979eb9530e6ea366c99d168587b87ea358dc908
This commit is contained in:
Ihar Hrachyshka 2016-01-13 11:35:12 +01:00
parent 4a974e61c8
commit 09a3e715ec

@ -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.