Skip to content

Commit a7b21cd

Browse files
Jenkinsopenstack-gerrit
authored andcommitted
Merge "Create LOGDIR earlier in the process"
2 parents c8f3ac2 + 09a3e71 commit a7b21cd

1 file changed

Lines changed: 15 additions & 14 deletions

File tree

stack.sh

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -299,16 +299,6 @@ EOF
299299
fi
300300
}
301301

302-
# If you have all the repos installed above already setup (e.g. a CI
303-
# situation where they are on your image) you may choose to skip this
304-
# to speed things up
305-
SKIP_EPEL_INSTALL=$(trueorfalse False SKIP_EPEL_INSTALL)
306-
307-
if is_fedora && [[ $DISTRO == "rhel7" ]] && \
308-
[[ ${SKIP_EPEL_INSTALL} != True ]]; then
309-
_install_epel_and_rdo
310-
fi
311-
312302

313303
# Configure Target Directories
314304
# ----------------------------
@@ -322,6 +312,11 @@ sudo mkdir -p $DEST
322312
safe_chown -R $STACK_USER $DEST
323313
safe_chmod 0755 $DEST
324314

315+
# Destination path for devstack logs
316+
if [[ -n ${LOGDIR:-} ]]; then
317+
mkdir -p $LOGDIR
318+
fi
319+
325320
# Destination path for service data
326321
DATA_DIR=${DATA_DIR:-${DEST}/data}
327322
sudo mkdir -p $DATA_DIR
@@ -335,6 +330,16 @@ if [ -z "`grep ^127.0.0.1 /etc/hosts | grep $LOCAL_HOSTNAME`" ]; then
335330
sudo sed -i "s/\(^127.0.0.1.*\)/\1 $LOCAL_HOSTNAME/" /etc/hosts
336331
fi
337332

333+
# If you have all the repos installed above already setup (e.g. a CI
334+
# situation where they are on your image) you may choose to skip this
335+
# to speed things up
336+
SKIP_EPEL_INSTALL=$(trueorfalse False SKIP_EPEL_INSTALL)
337+
338+
if is_fedora && [[ $DISTRO == "rhel7" ]] && \
339+
[[ ${SKIP_EPEL_INSTALL} != True ]]; then
340+
_install_epel_and_rdo
341+
fi
342+
338343
# Ensure python is installed
339344
# --------------------------
340345
is_package_installed python || install_package python
@@ -394,10 +399,6 @@ TIMESTAMP_FORMAT=${TIMESTAMP_FORMAT:-"%F-%H%M%S"}
394399
LOGDAYS=${LOGDAYS:-7}
395400
CURRENT_LOG_TIME=$(date "+$TIMESTAMP_FORMAT")
396401

397-
if [[ -n ${LOGDIR:-} ]]; then
398-
mkdir -p $LOGDIR
399-
fi
400-
401402
if [[ -n "$LOGFILE" ]]; then
402403
# Clean up old log files. Append '.*' to the user-specified
403404
# ``LOGFILE`` to match the date in the search template.

0 commit comments

Comments
 (0)