From c9ea9b3bd397f71ca649e24ab7c8003268b3302e Mon Sep 17 00:00:00 2001 From: Jiri Podivin Date: Thu, 9 Sep 2021 14:52:29 +0200 Subject: [PATCH] [Stable-Only]Reversing the legacy directory conditional The legacy directory can exist, but the validations don't have to be there. In such a case, the legacy directory would still be used by VF, instead of the new directory containing validation playbooks. This patch reverses the condition, so that the client first attempts to use the new validations playbook directory, and only if it doesn't exist falls back to the legacy one. Resolves: rhbz#2001968 Signed-off-by: Jiri Podivin (cherry picked from commit 9a586eb25dfcc6db7f0366bcbe4a7b293b0919d8) Change-Id: I6fb72ea7d170a2bcb0a1e3225d0fd8e9d97e0591 --- tripleoclient/constants.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/tripleoclient/constants.py b/tripleoclient/constants.py index 53c8530c9..12df5ebfa 100644 --- a/tripleoclient/constants.py +++ b/tripleoclient/constants.py @@ -104,11 +104,10 @@ ANSIBLE_INVENTORY = \ '/var/lib/mistral/overcloud/{}'.format(TRIPLEO_STATIC_INVENTORY) ANSIBLE_VALIDATION_DIR = ( - os.path.join(DEFAULT_VALIDATIONS_LEGACY_BASEDIR, 'playbooks') - if os.path.exists(os.path.join(DEFAULT_VALIDATIONS_LEGACY_BASEDIR, - 'playbooks')) - else "/usr/share/ansible/validation-playbooks" - ) + "/usr/share/ansible/validation-playbooks" + if os.path.exists("/usr/share/ansible/validation-playbooks") + else os.path.join(DEFAULT_VALIDATIONS_LEGACY_BASEDIR, + 'playbooks')) ANSIBLE_TRIPLEO_PLAYBOOKS = \ '/usr/share/ansible/tripleo-playbooks'