The current conversion works pretty well when passing a simple string
of validation or group names. But don't work when passing multiple
validation or group name.
```
>>> groups = "check-cpu"
>>> groups = [groups]
>>> print(groups)
['check-cpu']
>>> groups = "check-cpu,check-ram"
>>> groups = [groups]
>>> print(groups)
['check-cpu,check-ram']
```
This patch brings a better conversion when multiple validations or
groups are sent through a string.
Change-Id: Iba023a704dd873ea2df75c8cc6d78f929ef45bc2
Signed-off-by: Gael Chamoulaud (Strider) <gchamoul@redhat.com>
This patch also adds unittests and docstrings for the
show_validations_parameters method.
Change-Id: I7da1ef5607f6a7b164f87dace3a49a14e6cbf06f
Signed-off-by: Gael Chamoulaud (Strider) <gchamoul@redhat.com>
In some case we might get string instead of list - instead of failing,
just do a simple convertion and go on.
We also support both notation, either playbook name (foo.yaml) and
validation name (foo) in the search of valid content.
Co-Authored-By: Gael Chamoulaud (Strider) <gchamoul@redhat.com>
Change-Id: I8d0288dae3cab131a8bc65e3d0b986dc6b9aec67
Closes-Bug: #1901676
This patch fixes multiple things:
* from validations_libs.validation_actions import show_validations_parameters
The generated file was containing the validations names and their
existing parameters as returned by the get_validations_parameters
method. But the file should only contains the parameters.
* from validations_libs.utils import get_validations_playbook
This method was supposed to get a list of validations playbooks
abs. path either by their names or their groups. This method was working
only when giving validation names but not with groups.
This patch fixes all the problems above and make the parameters
management work again.
Change-Id: Iec30cccade1234a127ef406ed13604cce45a72fd
Signed-off-by: Gael Chamoulaud (Strider) <gchamoul@redhat.com>
When executing multiple validations with at least one unknown
validation, the CLI was executing only the existing ones but was not
informing the user that he/she typed one or more wrong validations.
This patch fixes that issue by detecting which validations are wrong and
inform the user.
Depends-On: https://review.opendev.org/758821
Change-Id: I4910043df07f32539793a2bc464377603fe2b02f
Signed-off-by: Gael Chamoulaud (Strider) <gchamoul@redhat.com>
Some environment still use python2.7 and so /usr/bin/python
interpreter for ansible.
In that case, Ansible will fail to execute.
This option allow the user to pass a specific python interpeter
for the remote.
In None python_interpreter, and connection local is set we use
the local sys.executable, if both are None we use the default.
Change-Id: I4bd25ed50091a963d0b1e5e3a727ece19b90747e
Show history filtered by plays to get a better view
if a log file contains a lot of playbooks.
Add get_status action in order to get debug information
of a given validation failure
Change-Id: I29ab90647d9ef9c86546065ca16a62c401be1969
Removing playbook parameters from run_validation function
since its overlap validation_name functionality and make it
confusing.
Change-Id: Ifff9bdb327b38db07df6cac328cbd387f2bc46f1
Since the user can provide a path to a directory which can
be polute by undesirable files, filter by extension can avoid
parsing wrong files
Change-Id: I378b32d58cd1ec3a5688bba0831716bf94f18f05
In order to run ansible on its own and get validations
progress and result with the CLI, the review adds an
option to run ansible asynchronously
Change-Id: Id884c9fd606ba03cb7d7fb02491582f1f88c3857
Globalize usage of the validation_path attribut set by
the __init__ instead of playing with variables which
introduce bugs and wrong usage
Change-Id: Ie61b380762c911d120076d50551b4661f1ef1526
Increase the unit tests coverage for recent code:
validation, group and logs classes.
(Increase of 54 unit tests)
Move per action files into one test file:
test_validation_actions
Change-Id: I7a1a8b0681c13ebd758a5686b2398a0a9e87a4eb
Create two classes for Log and Logs in order to get
a simpler representation of the validation Log and
provide easy way to manage the log data informations
Change-Id: I743355cef943e43492264d4c4700bebbeab9a37d
Move all validation actions into a ValidationActions class
in order to have one object with several validations actions
Add group info implementation
And add group object like validation object to have
a simpler representation of the validation group.
Change-Id: Idc7a55e26de20968f0a6a90f2a005d21a30c9e70