diff --git a/daemons/ganeti-cleaner.in b/daemons/ganeti-cleaner.in index 75cf5f0152280e0d9e0d91d162d428426b2bd638..50972c35f91d36e65ffa7c888f41c356a63d500f 100644 --- a/daemons/ganeti-cleaner.in +++ b/daemons/ganeti-cleaner.in @@ -113,6 +113,9 @@ exec >>$LOG_FILE 2>&1 echo "Cleaner started at $(date)" +# Switch to a working directory accessible to the cleaner +cd $CLEANER_LOG_DIR + # Remove old cleaner log files find $CLEANER_LOG_DIR -maxdepth 1 -type f | sort | head -n -$KEEP_LOGS | \ xargs -r rm -vf diff --git a/test/py/ganeti-cleaner_unittest.bash b/test/py/ganeti-cleaner_unittest.bash index bf57b762c1a7a4e1e397ed8d0d550f0de73cbfc7..cf38f737cf05d236c18a6280c7a354754ab9d7f8 100755 --- a/test/py/ganeti-cleaner_unittest.bash +++ b/test/py/ganeti-cleaner_unittest.bash @@ -24,7 +24,11 @@ set -o pipefail export PYTHON=${PYTHON:=python} GNTC=daemons/ganeti-cleaner -CCE=tools/check-cert-expired +CCE=$PWD/tools/check-cert-expired + +if [ "x$PYTHONPATH" = "x." ] +then export PYTHONPATH=$PWD +fi err() { echo "$@"