[stable/ussuri] Add support for the validations skip list feature
This patch adds a new --skiplist argument to the run sub command.
This feature allows the operator to provide a file with a list of
Validations to skip via the run sub command.
More details could be found in the official validations-libs
documentation [1].
Depends-On: https://review.opendev.org/c/openstack/validations-libs/+/809289
[1] - https://docs.openstack.org/validations-libs/latest/readme.html#skip-list
Signed-off-by: Gael Chamoulaud (Strider) <gchamoul@redhat.com>
Change-Id: Ibe6d56fc4eea93ab333fab237aa22e554fc245f3
(cherry picked from commit b7e50a9a15
)
This commit is contained in:
parent
eecb6d84c2
commit
70883be45e
|
@ -31,6 +31,7 @@ from tripleoclient.workflows import deployment
|
|||
|
||||
from validations_libs import constants as v_consts
|
||||
from validations_libs import utils as v_utils
|
||||
from validations_libs.cli import common as v_cli_common
|
||||
from validations_libs.validation_actions import ValidationActions
|
||||
from validations_libs.validation_logs import ValidationLogs
|
||||
|
||||
|
@ -274,6 +275,18 @@ class TripleOValidatorRun(command.Command):
|
|||
help=_("Python interpreter for Ansible execution. ")
|
||||
)
|
||||
|
||||
parser.add_argument(
|
||||
'--skiplist',
|
||||
dest='skip_list',
|
||||
default=None,
|
||||
help=_(
|
||||
"Path where the skip list is stored. "
|
||||
"An example of the skiplist format could "
|
||||
"be found at the root of the "
|
||||
"validations-libs repository."
|
||||
)
|
||||
)
|
||||
|
||||
extra_vars_group = parser.add_mutually_exclusive_group(required=False)
|
||||
|
||||
extra_vars_group.add_argument(
|
||||
|
@ -413,6 +426,12 @@ class TripleOValidatorRun(command.Command):
|
|||
undercloud_connection='local',
|
||||
return_inventory_file_path=True)
|
||||
|
||||
skip_list = None
|
||||
if parsed_args.skip_list:
|
||||
skip_list = v_cli_common.read_cli_data_file(parsed_args.skip_list)
|
||||
if not isinstance(skip_list, dict):
|
||||
raise RuntimeError("Wrong format for the skiplist.")
|
||||
|
||||
v_consts.DEFAULT_VALIDATIONS_BASEDIR = constants.\
|
||||
DEFAULT_VALIDATIONS_BASEDIR
|
||||
actions = ValidationActions()
|
||||
|
@ -426,7 +445,8 @@ class TripleOValidatorRun(command.Command):
|
|||
validation_name=parsed_args.validation_name,
|
||||
extra_env_vars=extra_env_vars,
|
||||
python_interpreter=parsed_args.python_interpreter,
|
||||
quiet=quiet_mode)
|
||||
quiet=quiet_mode,
|
||||
skip_list=skip_list)
|
||||
except RuntimeError as e:
|
||||
raise exceptions.CommandError(e)
|
||||
|
||||
|
|
Loading…
Reference in New Issue