Browse code

Create LOGDIR earlier in the process

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

Change-Id: I4979eb9530e6ea366c99d168587b87ea358dc908

Ihar Hrachyshka authored on 2016/01/13 19:35:12
Showing 1 changed files
... ...
@@ -297,16 +297,6 @@ EOF
297 297
     fi
298 298
 }
299 299
 
300
-# If you have all the repos installed above already setup (e.g. a CI
301
-# situation where they are on your image) you may choose to skip this
302
-# to speed things up
303
-SKIP_EPEL_INSTALL=$(trueorfalse False SKIP_EPEL_INSTALL)
304
-
305
-if is_fedora && [[ $DISTRO == "rhel7" ]] && \
306
-        [[ ${SKIP_EPEL_INSTALL} != True ]]; then
307
-    _install_epel_and_rdo
308
-fi
309
-
310 300
 
311 301
 # Configure Target Directories
312 302
 # ----------------------------
... ...
@@ -320,6 +310,11 @@ sudo mkdir -p $DEST
320 320
 safe_chown -R $STACK_USER $DEST
321 321
 safe_chmod 0755 $DEST
322 322
 
323
+# Destination path for devstack logs
324
+if [[ -n ${LOGDIR:-} ]]; then
325
+    mkdir -p $LOGDIR
326
+fi
327
+
323 328
 # Destination path for service data
324 329
 DATA_DIR=${DATA_DIR:-${DEST}/data}
325 330
 sudo mkdir -p $DATA_DIR
... ...
@@ -333,6 +328,16 @@ if [ -z "`grep ^127.0.0.1 /etc/hosts | grep $LOCAL_HOSTNAME`" ]; then
333 333
     sudo sed -i "s/\(^127.0.0.1.*\)/\1 $LOCAL_HOSTNAME/" /etc/hosts
334 334
 fi
335 335
 
336
+# If you have all the repos installed above already setup (e.g. a CI
337
+# situation where they are on your image) you may choose to skip this
338
+# to speed things up
339
+SKIP_EPEL_INSTALL=$(trueorfalse False SKIP_EPEL_INSTALL)
340
+
341
+if is_fedora && [[ $DISTRO == "rhel7" ]] && \
342
+        [[ ${SKIP_EPEL_INSTALL} != True ]]; then
343
+    _install_epel_and_rdo
344
+fi
345
+
336 346
 # Ensure python is installed
337 347
 # --------------------------
338 348
 is_package_installed python || install_package python
... ...
@@ -392,10 +397,6 @@ TIMESTAMP_FORMAT=${TIMESTAMP_FORMAT:-"%F-%H%M%S"}
392 392
 LOGDAYS=${LOGDAYS:-7}
393 393
 CURRENT_LOG_TIME=$(date "+$TIMESTAMP_FORMAT")
394 394
 
395
-if [[ -n ${LOGDIR:-} ]]; then
396
-    mkdir -p $LOGDIR
397
-fi
398
-
399 395
 if [[ -n "$LOGFILE" ]]; then
400 396
     # Clean up old log files.  Append '.*' to the user-specified
401 397
     # ``LOGFILE`` to match the date in the search template.