Create LOGDIR earlier in the process
Specifically, before _install_epel_and_rdo is called, that may need to log an
error.
Change-Id: I4979eb9530e6ea366c99d168587b87ea358dc908
diff --git a/stack.sh b/stack.sh
index 5e4a4f8..21a8051 100755
--- a/stack.sh
+++ b/stack.sh
@@ -297,16 +297,6 @@
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 @@
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 @@
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 @@
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.