Bug 1887777

Summary: The Validator run CLI doesn't take parameters coming from a file with the --extra-vars-file argument
Product: Red Hat OpenStack Reporter: Gaël Chamoulaud <gchamoul>
Component: python-validations-libsAssignee: Gaël Chamoulaud <gchamoul>
Status: CLOSED ERRATA QA Contact: nlevinki <nlevinki>
Severity: high Docs Contact:
Priority: high    
Version: 16.1 (Train)CC: cjeanner, drosenfe, jschluet, mbultel, slinaber, spower
Target Milestone: z4Keywords: Triaged
Target Release: 16.1 (Train on RHEL 8.2)   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: python-tripleoclient-12.3.2-1.20200914164931.el8ost python-validations-libs-1.0.5-1.20200914174431.el8ost Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-03-17 15:33:11 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1912879    
Bug Blocks:    

Description Gaël Chamoulaud 2020-10-13 10:35:40 UTC
Description of problem:

When running a validation with --extra-vars-file argument, the parameters contained in the file are taken in account during the execution.

Version-Release number of selected component (if applicable):

- python3-tripleoclient-12.3.2-1.20200914164928.el8ost.noarch
- validations-common-1.1.2-1.20200914180304.7f3c565.el8ost.noarch
- python3-validations-libs-1.0.5-1.20200914174429.4a660ec.el8ost.noarch
- openstack-tripleo-validations-11.3.2-1.20200914170825.el8ost.noarch
- python3-ansible-runner-1.3.4-2.el8ar.noarch


How reproducible:

$ openstack tripleo validator run --validation check-cpu
=> The validation should pass

$ openstack tripleo validator show parameter --validation check-cpu --download /tmp/check-cpu.json -f json
$ sed -i 's/\"minimal_cpu_count\": 8/\"minimal_cpu_count\": 120/' /tmp/check-cpu.json

$ openstack tripleo validator run --validation check-cpu --extra-vars-file /tmp/check-cpu.json
=> The validation should fail

Comment 6 David Rosenfeld 2021-01-25 13:30:54 UTC
Verification of this BZ is blocked by: https://bugzilla.redhat.com/show_bug.cgi?id=1912879

Comment 10 David Rosenfeld 2021-02-04 20:58:30 UTC
With this extra-var-file validation passes:
more /tmp/check-cpu.json
{
    "minimal_cpu_count": 1
}

openstack tripleo validator run --validation check-cpu --extra-vars-file /tmp/check-cpu.json
Running Validations without Overcloud settings.
+--------------------------------------+-------------+--------+------------+-------------------------------------+-------------------+-------------+
|                 UUID                 | Validations | Status | Host_Group |            Status_by_Host           | Unreachable_Hosts |   Duration  |
+--------------------------------------+-------------+--------+------------+-------------------------------------+-------------------+-------------+
| 87caf663-5adb-48ab-b23d-600475af0435 |  check-cpu  | PASSED |    all     | compute-0, controller-0, undercloud |                   | 0:00:02.798 |
+--------------------------------------+-------------+--------+------------+-------------------------------------+-------------------+-------------+

With this extra-var-file validation fails:
 more /tmp/check-cpu.json
{
    "minimal_cpu_count": 120
}

openstack tripleo validator run --validation check-cpu --extra-vars-file /tmp/check-cpu.json
Running Validations without Overcloud settings.
+--------------------------------------+-------------+--------+------------+-------------------------------------+-------------------+-------------+
|                 UUID                 | Validations | Status | Host_Group |            Status_by_Host           | Unreachable_Hosts |   Duration  |
+--------------------------------------+-------------+--------+------------+-------------------------------------+-------------------+-------------+
| 40b14321-9b7d-470b-b479-230b9a8b281c |  check-cpu  | FAILED |    all     | compute-0, controller-0, undercloud |                   | 0:00:02.802 |
+--------------------------------------+-------------+--------+------------+-------------------------------------+-------------------+-------------+

extra-var-file is being used because validation passes when one cpu is required and fails when 120 cpus are required.

Comment 16 errata-xmlrpc 2021-03-17 15:33:11 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 (Red Hat OpenStack Platform 16.1.4 director bug fix advisory), 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/RHBA-2021:0817

Comment 17 errata-xmlrpc 2021-03-17 15:38:00 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 (Red Hat OpenStack Platform 16.1.4 director bug fix advisory), 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/RHBA-2021:0817