New formatter prints text with proper line breaks
as well as the argument defaults.
Larger, and more frequently used, help strings were moved
to the validations_libs.cli.constants module.
Test was added for the conditional import of the cliff help formatter.
Signed-off-by: Jiri Podivin <jpodivin@redhat.com>
Change-Id: I26648b495e075fb0e6f9741693eca2feed3fc140
Unused workdir argument of the run_validations method removed.
Host and playbook skipping simplified.
Docstrings adjusted, including some of the more important
inline code examples.
Test sensitivity to API changes was increased.
More strict assertions have been put on the calls made in CLI.
Logging statements related to the run action
in validation_actions.py were expanded.
New debug level logging statements introduced.
One of the testing constants in the fakes.py was altered
as it was not accurate representation of the real data,
and as such was breaking the new logging statements
during unit test runs.
Deprecation notice for 'log_path' and 'groups' arguments,
in both docstring and logging.
Redundant conditionals for argument types were removed.
The checks of the arguments are implemented
in the function called in the subsequent statement.
As there is no scenario in which one set of these checks
passes, while the other fails with the same values,
we can consider one of them to be redundant.
Helper function 'get_validations_details' without active references
was removed from utils submodule.
Signed-off-by: Jiri Podivin <jpodivin@redhat.com>
Change-Id: I781f6a6f9fc4bd558af56b648f0e0ee9f165dfab
The validation framework now respect and look for community
validation on the path. There config setting for
enable_community_validations is respected.
The community validations appear on validations list,
can be called by group, category, id and so on seamless
like any other validation.
Change-Id: I4a6230ac5433028c7297fa88f77728c87d60173d
Signed-off-by: Adriano Petrich (apetrich) <apetrich@redhat.com>
Openstack Client and Validation Shell is hitting a regression
due to set_argument_parser calling directly parse_known_args
from argparse.
This patch fix the regression and avoid the need to call
parse_known_args directly.
Closes-Bug: #1949596
Change-Id: Ic9a682e7c3d5431e8779064947bd379c00aba584
Introduce validation config file.
The config default location of the config file will be stored
in /etc/validation.cfg
The variables precedence will be the following:
* user's cli args
* config file
* default interval values
Change-Id: I05c54a43bc0a03878793cca3f51e23f4a8b63a23
This patch adds the Cliff Sphinx Extension support for auto documenting
the `validation` Command Line Interface. It also standardizes the
`metavar` description for all the --group, --category and --product
arguments by using <group_id>, <category_id> and <product_id>.
Moreover, it removes usage example(s) in the arguments helpers which are often
duplicated with the `metavar`.
Change-Id: I3009337e8afadd705bbee5b89d9022c78093cdc8
Signed-off-by: Gael Chamoulaud (Strider) <gchamoul@redhat.com>
This patch adds the management of the new `products` metadata key in the
validation playbooks. We can now filter the validations by their groups,
by their categories or by their products while listing or running them.
The `list` sub command has now a new --product argument. When filtering
by groups, by categories or by products (see the example below), the
`list` sub command will return all the validation playbooks belonging to
the 'prep' group OR all the validation playbooks belonging to the 'os'
and/or 'system' categories OR all the validation playbooks to the
'tripleo' product:
$ validation list -h
$ validation list --group prep --category os,system --product tripleo
The `run` sub command has also its new --product argument. Note that
this new argument is mutually exclusive with the --validation, --group
and --category arguments:
$ validation run -h
$ validation run --product tripleo --inventory /etc/ansible/hosts
The `show parameter` sub command has the same new argument which is also
mutually exclusive with the --validation, --group and the --category
arguments:
$ validation show parameter -h
$ validation show parameter --product tripleo
Change-Id: Ief13e506c2bee18da47b31f1c2d5c0dbb1ad1ecf
Signed-off-by: Gael Chamoulaud (Strider) <gchamoul@redhat.com>
This patch adds the management of the new `categories` metadata key in
the validation playbooks. We can now filter the validations by their
groups and/or by their categories while listing or running them.
The `list` sub command has now a new --category argument. When filtering
by groups and by categories (see the example below), the `list` sub
command will return all the validation playbooks belonging to the prep
group OR all the validation playbooks belonging to the os and/or system
categories:
$ validation list -h
$ validation list --group prep --category os,system
The `run` sub command has also its new --category argument. Note that
this new argument is mutually exclusive with the --validation and
--group arguments:
$ validation run -h
$ validation run --category networking --inventory /etc/ansible/hosts
The `show parameter` sub command has the same new argument which is also
mutually exclusive with the --validation and --group arguments:
$ validation show parameter -h
$ validation show parameter --category os,system,hardware,ram
Change-Id: I4297f83355bdd209d21518fbadb17d1343fd4680
Signed-off-by: Gael Chamoulaud (Strider) <gchamoul@redhat.com>
The ShowGroup sub-command was not working anymore due
to a regression introduced by the new CLI next generation
commit[1].
This patch fixes the ShowGroup sub-command by addressing the
following points:
* The ValidationActions.group_information method should take
the absolute path of the groups.yaml file by default.
* Using cliff.lister.Lister base class instead of
cliff.show.ShowOne base class for the ShowGroup class.
Resolves: rhbz#1972155
[1] - 5fad1a4d18
Signed-off-by: Jiri Podivin <jpodivin@redhat.com>
Change-Id: Ia5aa3e96e8b5a6634a709ce8677f90108c80dfd3
New logging statements for the action and related
method call of 'ValidationActions' class.
Expanded exception handling for the 'show_validations_parameters'
method of the 'ValidationActions' class.
Removal of superfluous imports.
Signed-off-by: Jiri Podivin <jpodivin@redhat.com>
Change-Id: I2ad5a212dcd4cdb40ca04f7cce3d18c7527f63b2
This review adds a CLI for the Validation Framework which will become
the only entry point to run the Validation Framework.
It will deprecate the tripleo_validatior.py CLI and the
validation.py script.
This patch uses python cliff library to provide nice helpers, shell
and output formats.
Change-Id: I66800ad51cc50f4eb37efabe85fb553dce008101