Bug 1971607 - [RFE] Implement a Validation config file
Summary: [RFE] Implement a Validation config file
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat OpenStack
Classification: Red Hat
Component: python-validations-libs
Version: 17.0 (Wallaby)
Hardware: Unspecified
OS: Unspecified
high
medium
Target Milestone: Alpha
: 17.0
Assignee: mathieu bultel
QA Contact: David Rosenfeld
URL:
Whiteboard: Triaged
Depends On:
Blocks: 1985345
TreeView+ depends on / blocked
 
Reported: 2021-06-14 12:35 UTC by mathieu bultel
Modified: 2023-02-22 23:02 UTC (History)
10 users (show)

Fixed In Version: python-validations-libs-1.3.1-0.20210827002945.11488cd.el8ost
Doc Type: Enhancement
Doc Text:
With this update, the Validation Framework provides a configuration file in which you can set parameters for particular use. You can find an example of this file at the root of the code source or in the default location: `/etc/validation.cfg`. + You can use the default file in `/etc/` or use your own file and provide it to the CLI with the argument `--config`. + When you use a configuration file there is an order for the variables precedence. The following order is the order of variable precedence: + * User's CLI arguments * Configuration file * Default interval values
Clone Of:
Environment:
Last Closed: 2022-09-21 12:15:48 UTC
Target Upstream Version:
Embargoed:
scohen: needinfo+


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
OpenStack gerrit 792460 0 None MERGED Add validation config file mechanism 2022-06-08 12:20:34 UTC
Red Hat Issue Tracker OSP-5164 0 None None None 2022-02-08 13:03:00 UTC
Red Hat Issue Tracker VALFRWK-566 0 None None None 2021-08-31 12:32:44 UTC
Red Hat Product Errata RHEA-2022:6543 0 None None None 2022-09-21 12:16:42 UTC

Description mathieu bultel 2021-06-14 12:35:07 UTC
Description of problem:

Since the VF has a proper CLI included in validations-libs, it make sense to implement a validation.cfg config file in order to provide severals parameters through it.


For a 1st iteration the goals will be:

* the used of ConfigParser python builtin to avoid too much dependencies and links with other Openstack  projects.

* a minimal set of sections: default / ansible_runner / ansible_environment

The default will be the settings for the CLI parameters.
Ansible Runner, a way to override the ansible runner options
Ansible Environment will expose all the Ansible env variables available in Ansible so the user can edit, update, configure them without export each time those values.

* The precedence of the parameters will be as Ansible CLI does:
    * User CLI parameters take precedence on all the other values
    * The config is loaded on each run if found, and will override the default parameters
example:
config file:
[default]
validation_dir = /home/foo


$ validation run --validation foo --validation-dir /foo/bar
-> validation_dir is /foo/bar

$ validation run --validation foo
-> validation_dir is /home/foo

Config file not found:
$ validation run --validation foo
-> validation_dir is /usr/share/ansible/validation-playbooks

Comment 6 mathieu bultel 2022-08-26 07:34:06 UTC
Thank you Andy, I have added few informations for this BZ for the documentation.

Comment 10 errata-xmlrpc 2022-09-21 12:15:48 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (Release of components for Red Hat OpenStack Platform 17.0 (Wallaby)), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHEA-2022:6543


Note You need to log in before you can comment on or make changes to this bug.