From e18ccfa1dbd9b894b915ba3e40c80546c7804ad2 Mon Sep 17 00:00:00 2001 From: Ian Wienand Date: Mon, 16 Jun 2014 14:38:34 +1000 Subject: [PATCH] Make one copy of grenade log files Change 709f2349 removed the blanked 'rm' of grenade log files, but that leaves behind several confusing entries in the final log output; e.g [1]. --- grenade.sh.log.2014-06-16-014311 grenade.sh.log.2014-06-16-014311.2014-06-16-014311.summary grenade.sh.log.summary grenade.sh.txt --- grenade.sh.txt is greande.sh.log renamed, which was a symlink to the time-stampped file, which is no longer removed. The summary files are also duplicated and not directly visible because they do not have a .log extension. This change just keeps the grenade log and summary files. It renames the summary so it can be viewed, and removes the unnecessary files. It also puts grenade's localrc in the top-level directory with the logs, renamed to grenade_localrc [1] http://logs.openstack.org/83/98283/2/gate/gate-grenade-dsvm/8ba1473/logs/ Change-Id: I932ee1583f04756579abf63c792d336ae937f64d --- functions.sh | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/functions.sh b/functions.sh index d3f79fff..dca0fb41 100644 --- a/functions.sh +++ b/functions.sh @@ -535,7 +535,8 @@ function cleanup_host { # copy devstack log files if [ -d $BASE/old ]; then - sudo mkdir -p $BASE/logs/old $BASE/logs/new $BASE/logs/grenade + sudo mkdir -p $BASE/logs/old $BASE/logs/new + # copy all log files, but note that devstack creates a shortened # symlink without timestamp (foo.log -> foo.2014-01-01-000000.log) # for each log to latest log. Thus we just copy the symlinks to @@ -545,7 +546,22 @@ function cleanup_host { sudo cp $BASE/old/devstacklog.txt $BASE/logs/old/ sudo cp $BASE/old/devstack/localrc $BASE/logs/old/localrc.txt sudo cp $BASE/old/tempest/etc/tempest.conf $BASE/logs/old/tempest_conf.txt - sudo cp $BASE/new/grenade/localrc $BASE/logs/grenade/localrc.txt + + # grenade logs + sudo cp $BASE/new/grenade/localrc $BASE/logs/grenade_localrc.txt + # grenade logs directly and uses similar timestampped files to + # devstack. So temporarily copy out & rename the latest log + # files from the short-symlinks into grenade/, clean-up left + # over time-stampped files and put the interesting logs back at + # top-level for easy access + sudo mkdir -p $BASE/logs/grenade + sudo cp $BASE/logs/grenade.sh.log $BASE/logs/grenade/ + sudo cp $BASE/logs/grenade.sh.log.summary \ + $BASE/logs/grenade/grenade.sh.summary.log + sudo rm $BASE/logs/grenade.sh.* + sudo mv $BASE/logs/grenade/*.log $BASE/logs + sudo rm -rf $BASE/logs/grenade + NEWLOGTARGET=$BASE/logs/new else NEWLOGTARGET=$BASE/logs