When no hosts matched the callback and the cli return the validation
as failed state.
This patch move this status as 'skipped' and ignored instead of 'failed'.
Resolves: rhbz#2237500
Change-Id: I82bba29f802ef98e327c5421ef9a5079a3586d70
The current warning spams openstackclient output with multiple log messages
(one for every call to getLogger in the entrypoints that are loaded). Drop
the message to debug level.
Resolves: rhbz#2227201
Change-Id: Ib32146020f5869c88cc8becf41c9245a0c4863c3
Master jobs for OOO are no longer supported. We'll drop them and keep our own to make up for it.
Also removing the container test jobs, as they were made for use case we didn't
end up going for.
Signed-off-by: Jiri Podivin <jpodivin@redhat.com>
Change-Id: I330165fe839f7790943f0bdb2aec7d4abf9840cb
When executing validations by group or category or product, no validations execute and the message 'No validations found is displayed'. The condition has been updated, so the exception is raised properly.
Resolves: rhbz#2185881
Signed-off-by: Veronika Fisarova <vfisarov@redhat.com>
Change-Id: Icc1d4b83774c6374743f42d22970acea7f2eeb9c
This patch adds new command 'file'to the validation CLI. User can include and exclude validations by name(s), group(s), category(ies) or by product(s) and run them from YAML file with arbitrary parameters.
Resolves: rhbz#2122209
Depends-On: https://review.opendev.org/c/openstack/validations-common/+/872746/
Signed-off-by: Veronika Fisarova <vfisarov@redhat.com>
Change-Id: Ifc6c28003c4c2c5f3dd6198e650f9713a02dc82d
Fedora 35 image was move to the archives, hence is no more available on the container URL. The podman jobs are failing due to the 404 error. Container image version needs to be updated to use the Fedora 36.
Closes-Bug: #2012903
Signed-off-by: Veronika Fisarova <vfisarov@redhat.com>
Change-Id: I5d6c67e309709ff363575189ebc8c53541bbe7ff
Adjusted container file will provide pytest framework out of the box
to facilitate testing code from VS code IDE.
Package installation layers were consolidated in order to minimize
image size.
Default devcontainer configuration was added.
Signed-off-by: Jiri Podivin <jpodivin@redhat.com>
Change-Id: Id9fb1bf52bdf4c9d0bad09cd9604c4a4114c5b62
If the message in the validation log is a list, this patch
format it to a string, as expected, otherwise, if the message
another type, we just skip and move to default reason: Unknown
Change-Id: I7d434408ab0af67967e9c1407a8e286daee51769
This patch check the presence of the output callback *vf_validation_json*
which is mandatory for a correct behavior of the VF.
Without this checks the VF will execute the ansible command,
but wont be able to find the json log associated to the run,
and will failed at the end.
This check prevent useless investigations and save time for the user.
It also check the presence of the roles path (if one of all the paths is correct)
to prevent as well strange behavior from Ansible and the framework.
Change-Id: Iea6fc17ec4da91df652be0a0cb9338e3c512f141
Logger was introduced in If8ed6510dad16dc8495717789bb132b957828e0d
and so far has been performing admirably.
We can now expand it to the rest of the library and remove leftovers
from the original setup. This way we can establish proper monitoring
of code execution across our tool and provide operators with
more actionable information.
Signed-off-by: Jiri Podivin <jpodivin@redhat.com>
Change-Id: I3dd296c8b8b9a33f87a451dd7bef68b38ba60af7
It seems flake8 is no longer available in Gitlab. This change switches
the source from Gitlab to Github to avoid the following failure.
fatal: could not read Username for 'https://gitlab.com': No such device
or address
(@matbu: moving podman CI job to non-voting to unblock this patch)
Closes-Bug: #1996668
Depends-on: https://review.opendev.org/c/openstack/tripleo-ci/+/864603
Change-Id: I5e50c0e9ffe2ab8cc527f2f2b4c887b09c5b1431
It is no longer supported by jammy and lead us to the following errors with the announce-release job.
```
No package matching 'python-dev' is available
```
Change-Id: I89be9dea4a1d7d7c3d8d1910adddbc111defa55a
This parameter was deprecates, this patch clean the log path parameter
in the ValidationAction function.
Change-Id: I92bc1bdc7341308fd1989f78601e491f72f9bf6c
The logging statements in our modules, including CLI, are now
using a dedicated VF logger with Syslog and stdout handlers.
This will ensure, that all messages will be properly journaled
and that only messages >warn will be displayed to user by default.
Patch only changes behavior of the logging statements in the VF
code itself. Log statements in imported modules, such as ansible-runner,
will behave as before.
In the absence of available '/dev/log' device the user will be notified,
during logger init, by a warning level message.
Tests for the new code are included.
Signed-off-by: Jiri Podivin <jpodivin@redhat.com>
Change-Id: If8ed6510dad16dc8495717789bb132b957828e0d
Centos 8 is no longer actively maintained, furthermore some of the repos
have changed their URLs so they are now unreachable.
Moving project to stream is the easiest way forward.
Signed-off-by: Jiri Podivin <jpodivin@redhat.com>
Change-Id: Ic70f0cf692f5efaf4129ee1f16726a7803d2cd73
Several of our modules have accumulated unused statements, mostly imports,
unused in the rest of the code and without any apparent purpose.
While not compromising functionality of our code directly,
they needlessly increase our cognitive load, and can potentially,
in absence of proper mitigation, introduce issues down the line.
Signed-off-by: Jiri Podivin <jpodivin@redhat.com>
Change-Id: I03da08a195a8468e4056522878ba3b391a368e14
This review loop over the configuration file sections
instead of taking as paremeter the section and only
set the parameters by section one by one with the 'default'
for default section.
This avoid to set explicitely each sections as parameters.
Change-Id: I068e57e18b256907ce54bf48e753d496dec5327d
New issues were encountered during unit test execution on local machines,
caused by introduction of new runtime and unexpected mock behavior.
Patch limits the test execution enviornmnet to Python3.8, while removing
offending autospecced mocks from unit tests.
Closes-Bug: #1982750
Signed-off-by: Jiri Podivin <jpodivin@redhat.com>
Change-Id: I67e7e594cb1aa4f6043c1ca1869828efc7f119b5
Argument 'retcode_only' of the function and associated logic was removed
as it was not beneficial to the purpose, or use of the function.
Before this patch, only call of the function setting 'retcode_only'
to 'True' was made in tests of the validations-libs. All other calls
worked with assumption that Bool, not object will be returned,
and didn't supply the argument explicitly. Instead relying on
the default value.
In addition, it is not clear how would the Popen[0] object be
used, if it was returned.
The function has limited impact across Openstack[1],
only calls to it are made within validations-libs, although there is
a homonymous function withing tripleoclient intended
for the same task.
Docstring and tests were adjusted accordingly.
[0]https://docs.python.org/3/library/subprocess.html#popen-objects
[1]https://codesearch.openstack.org/?q=run_command_and_log&i=nope&literal=nope&files=&excludeFiles=&repos=
Signed-off-by: Jiri Podivin <jpodivin@redhat.com>
Change-Id: I3f9c2ef364de645a99d28c45c96560b78862c848
Centos container file[0] has not been updated in considerable time
and is increasingly out of sync with environment VF is meant to interact with.
Moving to UBI9[1] should prevent potential issues of stemming
from aformentioned divergence.
Furthermore, several minor stylistic issues of the existing container file
were resolved, such as comments and uperfluous commands.
Consequently the version was incremented to 1.0.
[0]https://hub.docker.com/_/centos
[1]https://hub.docker.com/r/redhat/ubi9
Signed-off-by: Jiri Podivin <jpodivin@redhat.com>
Change-Id: Ied821c2a7210d8131e154020272c46048372af29
KeyValueAction previously allowed only one key=>value pair to be
supplied in the CLI per argument.
While the operator could supply multiple key=>value pairs by repeatedly
using the same argument it was unnecessarily verbose and tedious approach.
Similar behavior is implemented in the tripleoclient validator CLI
by the resulution to the rhbz#1959492 [0].
Tests were adjusted.
[0]https://bugzilla.redhat.com/show_bug.cgi?id=1959492:
Signed-off-by: Jiri Podivin <jpodivin@redhat.com>
Change-Id: I28c40bb8156d73dd95af9641acaab3cce721be2d
The lowest version of python supported will be Python 3.8,
to keep up with some of the adjacent components and CI jobs.
Releated-Bug: #1974244
Change-Id: I1dda9fc3ab1425403e501ce59211e3828373ee90
In Zed cycle, we have dropped the python 3.6/3.7[1] testing
and its support. Removing the py36 centos8 job as well as
updating the python classifier also to reflect the same.
[1] https://governance.openstack.org/tc/reference/runtimes/zed.html
Change-Id: I205e4e91d1560e155d6f443051fb778cd1de5d80
Moving to version 1.12.0 will allow the library to handle the newest version
of our code intended for python runtimes >= 3.8
Closes-Bug: #1977495
Signed-off-by: Jiri Podivin <jpodivin@redhat.com>
Change-Id: Ieb3d9b34048a624da0aca8d9cd095e5a06942d30
Python 2 is no longer supported, thus usage of six can be removed.
This change also upates setup.cfg to enforce usage of Python 3.
Change-Id: I0be22a80afbe9f16191384466fe2ba496a7ef63e