scripts: scripts-library.sh: Fix location for log directory

The AIO job did not collect any logs from the host because the working
directory was changing due to pushd commands and the logs were placed
into the wrong location. We already have the root location in the
OSA_CLONE_DIR variable so lets use that and only try to detect it if
that variable is empty for whatever reason.

Change-Id: I17cc321ab640da4e251d21a996b537bda8cb3c1d
This commit is contained in:
Markos Chandras 2017-08-24 07:06:48 +01:00
parent 2143a43715
commit 836703a0c3

View File

@ -125,7 +125,7 @@ function gate_job_exit_tasks {
# If this is a gate node from OpenStack-Infra Store all logs into the
# execution directory after gate run.
if [ "$GATE_EXIT_LOG_COPY" == true ]; then
GATE_LOG_DIR="$(dirname "${0}")/../logs"
GATE_LOG_DIR="${OSA_CLONE_DIR:-$(dirname $0)/..}/logs"
mkdir -p "${GATE_LOG_DIR}/host" "${GATE_LOG_DIR}/openstack"
rsync --archive --verbose --safe-links --ignore-errors /var/log/ "${GATE_LOG_DIR}/host" || true
rsync --archive --verbose --safe-links --ignore-errors /openstack/log/ "${GATE_LOG_DIR}/openstack" || true