Merge "[Train-Only] Run Validations outside of mistral for the deployment" into stable/train

This commit is contained in:
Zuul 2021-10-07 15:21:40 +00:00 committed by Gerrit Code Review
commit fc4901f6e4
2 changed files with 21 additions and 5 deletions

View File

@ -45,6 +45,8 @@ from tripleoclient.workflows import deployment
from tripleoclient.workflows import parameters as workflow_params
from tripleoclient.workflows import plan_management
from validations_libs.validation_actions import ValidationActions
class DeployOvercloud(command.Command):
"""Deploy Overcloud"""
@ -276,11 +278,29 @@ class DeployOvercloud(command.Command):
if not update_plan_only:
print("Deploying templates in the directory {0}".format(
os.path.abspath(tht_root)))
if run_validations:
actions = ValidationActions()
results = actions.run_validations(
inventory='undercloud',
log_path=constants.VALIDATIONS_LOG_BASEDIR,
validations_dir=constants.ANSIBLE_VALIDATION_DIR,
group='pre-deployment')
failed_list = [r.get('UUID') for r in results
if r.get('Status') == 'FAILED']
if failed_list:
msg = ("Validations has failed, check log results "
"under {}, for: {}.")
raise exceptions.DeploymentError(
msg.format(constants.VALIDATIONS_LOG_BASEDIR,
', '.join(failed_list))
)
# Force run_validations to False in order to skip the mistral
# Validation run.
deployment.deploy_and_wait(
self.log, self.clients, stack,
stack_name, self.app_args.verbose_level,
timeout=timeout,
run_validations=run_validations,
run_validations=False,
skip_deploy_identifier=skip_deploy_identifier,
deployment_options=deployment_options)

View File

@ -30,7 +30,6 @@ from oslo_config import cfg
from tripleoclient import constants
from tripleoclient import utils
from validations_libs import constants as v_consts
from validations_libs.validation_actions import ValidationActions
@ -94,9 +93,6 @@ def _check_diskspace(upgrade=False):
playbook = 'undercloud-disk-space.yaml'
with utils.TempDirs() as tmp:
# @matbu: todo: removed this when [1] will be merged
# [1] https://review.opendev.org/753845
v_consts.VALIDATION_ANSIBLE_ARTIFACT_PATH = "{}/artifacts".format(tmp)
actions = ValidationActions()
actions.run_validations(
inventory='undercloud',