Add a new test to raise exeception if you have no groups in your playbook.
Co-authored-by: Daniel Bengtsson <dbengt@redhat.com>
Change-Id: I984304ec22511709370e36f4b4fb6a43100b043c
If there are no groups in the playbook, we currently get a python error
when running command 'openstack tripleo validator group info'
Change-Id: Ice089c33d566e90bea55e18fe7f77f9d33fe81f3
os.path.join can accept arbitrary number of path likes,
nesting the calls is therefore unnecessary.
Signed-off-by: Jiri Podivin <jpodivin@redhat.com>
Change-Id: I19010de832b2dd0b7f1b4940c9f770929d041053
Performance improvement is purely hypothetical.
However, the altered code is more readable.
Signed-off-by: Jiri Podivin <jpodivin@redhat.com>
Change-Id: Iaa85213a439ee4222c3d7fa6fc513458095b8ac3
This patch depends on the callback modifcation which
allow to give other custom or default/standard callback
for the stdout from the user.
With the current situation, when passing another callback
than validation_json it breaks the VF logging.
We need to separate logging and stdout.
Change-Id: I1566d9763212f9538fea1c0885208db6b949023f
Upstream requirements in stable/train is under ansible-runner 1.4.0.
This patch move the version to 1.4.0 according to openstack/requirements.
It changes the backward compat version according to this version in
validations_libs/ansible.py
Change-Id: I311d077c13a7d95314eb83072f5652646fef1bf8
This file, and its tests, are not useful for tripleo so we're
removing because they're now becoming problematic.
Change-Id: Ibba148d3763fcf54988241a33c7d2c2c67c6ef9a
Signed-off-by: Kevin Carter <kecarter@redhat.com>
This patch also uses pycqa/flake8 instead of the default one proposed by
pre-commit and which is deprecated.
Change-Id: Iba243abc1ec01912edb4b3645f8ccce95e0f2e88
Signed-off-by: Gael Chamoulaud (Strider) <gchamoul@redhat.com>
This patch also adds new unittests.
Change-Id: I6f299db1b22d98fdabc148e297098e023cf863bd
Signed-off-by: Gael Chamoulaud (Strider) <gchamoul@redhat.com>
This patch ensures that the playbook is respecting the minimal structure
of a validation. This patch also adds DocStrings to the Validation class
and new unittests according to the enforcement changes.
Change-Id: I0809163cbd661cbd24705ed348281c7818a944b4
Signed-off-by: Gael Chamoulaud (Strider) <gchamoul@redhat.com>
This patch also adds new unittests for the following functions:
- from validations_libs.utils import get_validations_data
> test_get_validations_data_wrong_type(..)
- from validations_libs.utils import get_validations_details
> test_get_validations_details_wrong_type(..)
Change-Id: Iac9ba971a73ed09b26d3e41efb38ad72dd942bbc
Signed-off-by: Gael Chamoulaud (Strider) <gchamoul@redhat.com>
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>
Added a development environment shortcut by way of Vagrantfiles for
CentOS and Ubuntu; also updated README.rst to indicate usage.
Change-Id: I561ecd6cede3c5cdb7605e368d2b031b05612133
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>
The CI roles are stored on both repos:
validations-common and validations-libs.
We need to stored those roles only in one place.
This review removed the roles from validations-libs
and used it from validations-common
Change-Id: Ia343509716f0a7769c8edcd502a678927935b419
In order to install new ansible roles in /usr/share/ansible/roles
ansible is required as rpm dependency.
refers to review I0198834772323504f69244664307fbb8dfe7dd7c
RPM depencies are sync to projects requirements in order to keep
it clean this dependency should be added
Version tooked from tripleo-ansible requirements.txt
Change-Id: I52afb89fe5f5a0824a5808c7623087257aa23c0a