From df0cecfe55b9ce87d4ad5cf49e94298051ee3890 Mon Sep 17 00:00:00 2001 From: Mathieu Bultel Date: Tue, 1 Sep 2020 21:57:43 +0200 Subject: [PATCH] Update tripleo-validations path to /usr/share/ansible According to: https://review.rdoproject.org/r/#/c/29059/ We decide to converge ansible roles/libraries/plugin and playbooks to the /usr/share/ansible path instead of having a dedicated path for validations. This will avoid duplication since the validation-framework is now an external framework from tripleo, the common validations between validations-common and tripleo-validations can be stored at the same place. Add a fallback path for Updates and Upgrades Change-Id: Ibe97d70f4d321d04900ca9fe88144bc16511611c --- tripleoclient/constants.py | 12 +++++++++--- .../tests/v1/tripleo/test_tripleo_validator.py | 2 +- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/tripleoclient/constants.py b/tripleoclient/constants.py index 12879a8a5..636f8e239 100644 --- a/tripleoclient/constants.py +++ b/tripleoclient/constants.py @@ -93,7 +93,10 @@ ENABLE_SSH_ADMIN_SSH_PORT_TIMEOUT = 600 ADDITIONAL_ARCHITECTURES = ['ppc64le'] -DEFAULT_VALIDATIONS_BASEDIR = '/usr/share/openstack-tripleo-validations' +DEFAULT_VALIDATIONS_BASEDIR = ( + "/usr/share/ansible" + if os.path.exists("/usr/share/ansible/validation-playbooks") + else "/usr/share/openstack-tripleo-validations") VALIDATIONS_LOG_BASEDIR = '/var/log/validations' @@ -103,8 +106,11 @@ DEFAULT_WORK_DIR = os.path.join(os.environ.get('HOME', '~/'), ANSIBLE_INVENTORY = os.path.join(DEFAULT_WORK_DIR, '{}/tripleo-ansible-inventory.yaml') -ANSIBLE_VALIDATION_DIR = \ - '/usr/share/openstack-tripleo-validations/playbooks' +ANSIBLE_VALIDATION_DIR = ( + "/usr/share/ansible/validation-playbooks" + if os.path.exists("/usr/share/ansible/validation-playbooks") + else "/usr/share/openstack-tripleo-validations/playbooks") + ANSIBLE_TRIPLEO_PLAYBOOKS = \ '/usr/share/ansible/tripleo-playbooks' diff --git a/tripleoclient/tests/v1/tripleo/test_tripleo_validator.py b/tripleoclient/tests/v1/tripleo/test_tripleo_validator.py index 69e09014f..5c73f1869 100644 --- a/tripleoclient/tests/v1/tripleo/test_tripleo_validator.py +++ b/tripleoclient/tests/v1/tripleo/test_tripleo_validator.py @@ -50,7 +50,7 @@ VALIDATIONS_LOGS_CONTENTS_LIST = [{ 'id': '008886df-d297-1eaa-2a74-000000000008', 'validation_id': '512e', 'validation_path': - '/usr/share/openstack-tripleo-validations/playbooks' + '/usr/share/ansible/validation-playbooks' }, 'tasks': [ {