From b3903d2a8129b6b941c42928f7a2c462808a36bf Mon Sep 17 00:00:00 2001 From: Jiri Podivin Date: Thu, 6 May 2021 12:01:29 +0200 Subject: [PATCH] Constants path formatting unification Paths in the constants.py are now formatted using a single function, the os.path.join. This both normalizes the code and reduces chance of errors and confusion arising from nonstandard paths. Signed-off-by: Jiri Podivin Change-Id: I761c4449579590b9081a78627eeac754d6b04e2a --- validations_libs/constants.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/validations_libs/constants.py b/validations_libs/constants.py index c1ebd566..fa97ea36 100644 --- a/validations_libs/constants.py +++ b/validations_libs/constants.py @@ -18,7 +18,9 @@ DEFAULT_VALIDATIONS_BASEDIR = '/usr/share/ansible/' ANSIBLE_VALIDATION_DIR = '/usr/share/ansible/validation-playbooks' -VALIDATION_GROUPS_INFO = '%s/groups.yaml' % DEFAULT_VALIDATIONS_BASEDIR +VALIDATION_GROUPS_INFO = os.path.join( + DEFAULT_VALIDATIONS_BASEDIR, + 'groups.yaml') VALIDATION_GROUPS = ['no-op', 'prep', @@ -26,5 +28,6 @@ VALIDATION_GROUPS = ['no-op', VALIDATIONS_LOG_BASEDIR = os.path.join(os.environ.get('HOME'), 'validations') -VALIDATION_ANSIBLE_ARTIFACT_PATH = '{}/artifacts/'.format( - VALIDATIONS_LOG_BASEDIR) +VALIDATION_ANSIBLE_ARTIFACT_PATH = os.path.join( + VALIDATIONS_LOG_BASEDIR, + 'artifacts')