Commit Graph

413 Commits

Author SHA1 Message Date
Ghanshyam Mann 2847a85880 Retire Tripleo: remove repo content
TripleO project is retiring
- https://review.opendev.org/c/openstack/governance/+/905145

this commit remove the content of this project repo

Change-Id: I4c3b6ffc2e3e2a204d4b5f6f0a726998f758de8c
2024-02-24 11:45:08 -08:00
matbu 8d9e1b5dfd Move No hosts matched status to skipped instead of failed
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
2023-09-12 17:20:53 +02:00
Zuul fbd4983d56 Merge "Truncating the Reasons column in CLI output if it is too long" 2023-08-02 11:45:40 +00:00
Oliver Walsh feba372e2d Drop lack of syslog warning to debug level logging
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
2023-08-01 14:22:15 +00:00
Jiri Podivin 7083d2ab4c Truncating the Reasons column in CLI output if it is too long
Resolves: rhbz#2217999

Signed-off-by: Jiri Podivin <jpodivin@redhat.com>
Change-Id: I29aa2e42ebe6df62ff69db2242a27a6096ee2fc4
2023-08-01 14:21:32 +00:00
Jiri Podivin 70c3ac1d14 Removing OOO branch jobs
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
2023-08-01 10:39:55 +02:00
Veronika Fisarova 72134198cb No validation found exception is raised when group or category or product is defined
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
2023-04-12 10:27:12 +02:00
Veronika Fisarova 136827b8fe Run validations with parameters from a file
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
2023-03-27 14:54:26 +00:00
Veronika Fisarova 6bd2a45eac Update container validation to use Fedora image version 36
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
2023-03-27 08:27:03 +00:00
Jiri Podivin cc370a5dd1 Adjusting developer container file to ensure smoother integration with IDE
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
2023-01-30 13:44:35 +01:00
Jiri Podivin 0c29d457a8 Changes needed for full functionality of tox 4.0.0 runtime
Closes-Bug: #2000867

Signed-off-by: Jiri Podivin <jpodivin@redhat.com>
Change-Id: Ib9e3d5c1a8bde890f915cf28baf58695a008abc9
2023-01-06 10:11:42 +00:00
Zuul 430530fad5 Merge "Expanding logging facilities to rest of the framework" 2022-12-19 13:23:11 +00:00
Zuul 0464162d64 Merge "Check the presence of the output callback and the roles path" 2022-12-01 17:13:08 +00:00
matbu ac2b6b7b7e Format list to str for get_reason message or skip
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
2022-11-25 09:02:21 +00:00
matbu a7b2d9788d Check the presence of the output callback and the roles path
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
2022-11-23 14:22:00 +00:00
Jiri Podivin 5a23115811 Expanding logging facilities to rest of the framework
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
2022-11-23 09:16:18 +00:00
Jiri Podivin 9a2bcee59f Bumping basepython version of the tox environments to 3.10
Closes-Bug: #1997256

Signed-off-by: Jiri Podivin <jpodivin@redhat.com>
Change-Id: I32d163970ef1ab4d6159670a0619ffd037eca1de
2022-11-22 13:35:03 +01:00
matbu e6eeba3bea Install podman with privilege escalation
(moving back the podman job to voting)

Change-Id: I503689d38ecf5008a309fe5e3c49fceb45323900
2022-11-17 14:51:34 +01:00
Zuul b520719f77 Merge "Pull flake8 from Github" 2022-11-17 13:38:06 +00:00
Takashi Kajinami 0cd855c450 Pull flake8 from Github
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
2022-11-16 16:50:14 +01:00
Hervé Beraud 5fb5a02716 Remove python-dev from bindep
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
2022-11-07 11:12:27 +01:00
Zuul 70e174acf7 Merge "Remove log_path parameter so it can be only set by the constructor" 2022-10-27 17:32:09 +00:00
matbu 2e7216b3fe Remove log_path parameter so it can be only set by the constructor
This parameter was deprecates, this patch clean the log path parameter
in the ValidationAction function.

Change-Id: I92bc1bdc7341308fd1989f78601e491f72f9bf6c
2022-09-30 10:28:04 +02:00
Zuul 0dcf77de8c Merge "Restoring logging facility and implementing default logger" 2022-09-27 15:28:27 +00:00
Zuul 125e237bf3 Merge "remove unicode prefix from code" 2022-09-20 17:28:16 +00:00
Zuul 2fd3bd200c Merge "Removing Popen object return from utils.run_command_and_log" 2022-09-20 17:28:07 +00:00
Jiri Podivin bb98dea067 Restoring logging facility and implementing default logger
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
2022-09-20 09:46:02 +02:00
Zuul eff451b3c5 Merge "Add CI job for podified VF" 2022-09-15 19:38:37 +00:00
Zuul 68600297fd Merge "Constraining runtime selection and behavior to improve local testing stability" 2022-09-15 17:49:45 +00:00
Zuul b450dcd876 Merge "Updating development vagrant file to centos8 stream" 2022-09-15 16:05:02 +00:00
Zuul 9b06652abd Merge "Removing superfluous imports and variable" 2022-09-15 16:05:00 +00:00
Jiri Podivin b4fed7a1c4 Updating development vagrant file to centos8 stream
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
2022-09-15 12:05:52 +02:00
matbu 791203c79a Add CI job for podified VF
Add CI for podified in order to test the build and the run, to make
sure nothing breaks.

Change-Id: Ide984601c01e8f2a1f1c522ea547be0a770f9a79
2022-09-14 16:27:34 +02:00
Jiri Podivin 3a3ea531e6 Removing superfluous imports and variable
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
2022-09-13 09:38:28 +02:00
matbu c602a0843a Define and loop on config file section
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
2022-09-01 09:21:08 +02:00
niuke 55e0969517 remove unicode prefix from code
Change-Id: I58eaf23bde1bace985a1d80638c4edc0b020cdd5
2022-08-23 19:37:46 +08:00
Jiri Podivin b191190a6b Constraining runtime selection and behavior to improve local testing stability
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
2022-07-27 08:01:21 +00:00
Jiri Podivin 8a69f95e0a Removing Popen object return from utils.run_command_and_log
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
2022-07-25 10:40:50 +02:00
Zuul 5076004733 Merge "Expanding parser actions to allow for multiple key-value pairs" 2022-07-22 15:03:59 +00:00
Zuul ec891e014b Merge "Skipping tests during API doc generation" 2022-07-19 15:37:58 +00:00
Jiri Podivin 14a681b809 Using UBI9 as base for VF development containers
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
2022-07-08 17:02:21 +02:00
Jiri Podivin b27ad5ae42 Minor style violations fix
Signed-off-by: Jiri Podivin <jpodivin@redhat.com>
Change-Id: I335e1660f56fa254ffd3c6728d4fe4bf9563284f
2022-06-30 09:46:55 +00:00
Jiri Podivin 9bf191d295 Adding yamllint configuration file and fixing style violations
Signed-off-by: Jiri Podivin <jpodivin@redhat.com>
Change-Id: I13d8b91c20a08d0b59bd644bd19605311355be05
2022-06-30 09:46:49 +00:00
Zuul 332f6807e8 Merge "Update python testing as per zed cycle testing runtime" 2022-06-28 17:12:20 +00:00
Jiri Podivin 5cad282b80 Expanding parser actions to allow for multiple key-value pairs
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
2022-06-27 07:52:35 +00:00
matbu 9047bbb317 Python 3.6 support removal
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
2022-06-06 06:22:08 +00:00
jiangzhilin cb419129ca Update python testing as per zed cycle testing runtime
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
2022-06-04 07:38:19 +00:00
Zuul 79571b7482 Merge "Bumping flake8-typing-imports to version 1.12.0" 2022-06-03 21:46:47 +00:00
Jiri Podivin 134f49e1cc Bumping flake8-typing-imports to version 1.12.0
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
2022-06-03 11:50:40 +02:00
Takashi Kajinami c8fb5bfa2e Remove six
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
2022-06-03 08:11:00 +00:00