[Train-Only] Run Validations outside of mistral for the deployment

In Train we still run Validation over Mistral for the Deployment which
is broken atm. Some pieces of the code has been dropped which make
the option --run-validations broken.

This review just call, like the undercloud-preflight Validations, the
Validation Framework instead of Mistral.

The results and output if some Validations failed will be easier to
debug, which is very difficult to do in the Mistral context.

Relared BZ:
https://bugzilla.redhat.com/show_bug.cgi?id=1974353

Change-Id: I88d7d09c2f3cf1b5bb23bca3e1436ea8e2ca0d07
This commit is contained in:
matbu 2021-09-02 14:04:33 +02:00 committed by mbu
parent 956ea28e60
commit 52ee6e15f7
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',