From f07c8e73bbed4411830aedeadca36b0f0f270274 Mon Sep 17 00:00:00 2001 From: Jiri Podivin Date: Tue, 25 May 2021 16:55:06 +0200 Subject: [PATCH] New location of the default log directory. Json callback now expects the log directory to be $HOME/validations. Just as defined in the validations libs. Depends-On: https://review.opendev.org/c/openstack/validations-libs/+/795093 Signed-off-by: Jiri Podivin Change-Id: Id1d39fd907eb154a601da68e9f75756cccfbf91c --- .../callback_plugins/validation_json.py | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/validations_common/callback_plugins/validation_json.py b/validations_common/callback_plugins/validation_json.py index 1286f60..918eb96 100644 --- a/validations_common/callback_plugins/validation_json.py +++ b/validations_common/callback_plugins/validation_json.py @@ -30,17 +30,16 @@ DOCUMENTATION = ''' version_added: "1.0" description: - This callback converts all events into a JSON file - stored in /var/log/validations + stored in the selected validations logging directory, + as defined by the $VALIDATIONS_LOG_DIR env variable, + or the $HOME/validations by default. type: aggregate requirements: None ''' -VALIDATIONS_LOG_DIR = (os.getenv('VALIDATIONS_LOG_DIR') - if os.getenv('VALIDATIONS_LOG_DIR') else - ('/var/log/validations' - if os.path.exists('/var/log/validations') - and os.access('/var/log/validations', os.W_OK) else - os.environ.get('PWD'))) +VALIDATIONS_LOG_DIR = os.environ.get( + 'VALIDATIONS_LOG_DIR', + os.environ.get('HOME')) def current_time():