Bug 1953552

Summary: Validation run doesn't work when passing a static inventory by its relative path and only by passing an absolute path.
Product: Red Hat OpenStack Reporter: Gaël Chamoulaud <gchamoul>
Component: python-validations-libsAssignee: mathieu bultel <mbultel>
Status: CLOSED ERRATA QA Contact: David Rosenfeld <drosenfe>
Severity: high Docs Contact:
Priority: high    
Version: 16.1 (Train)CC: drosenfe, jhajyahy, jpodivin
Target Milestone: z7Keywords: Triaged
Target Release: 16.1 (Train on RHEL 8.2)   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: python-validations-libs-1.0.5-1.20210429080935.4a660ec.el8ost Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-12-09 20:19:00 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:

Description Gaël Chamoulaud 2021-04-26 11:25:21 UTC
Description of problem:

When passing the relative path to static inventory file when running a validation, the inventory is not taken in consideration. It only work if passing the absolute path. 

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

- python3-validations-libs-1.0.5-1.20210326153612.4a660ec.el8ost.noarch

How reproducible:

(undercloud) [stack@undercloud-0 ~]$ openstack tripleo validator run --validation check-cpu --static-inventory inventory.yaml
Running Validations without Overcloud settings.
+--------------------------------------+-------------+--------+------------+----------------+-------------------+----------+
|                 UUID                 | Validations | Status | Host_Group | Status_by_Host | Unreachable_Hosts | Duration |
+--------------------------------------+-------------+--------+------------+----------------+-------------------+----------+
| 34a71bf3-2429-4344-9198-9258d5679baa |  check-cpu  | PASSED |    all     |                |                   |          |
+--------------------------------------+-------------+--------+------------+----------------+-------------------+----------+

(undercloud) [stack@undercloud-0 ~]$ openstack tripleo validator show run 34a71bf3-2429-4344-9198-9258d5679baa --full
{
    "plays": [
        {
            "play": {
                "duration": {
                    "start": "2021-04-26T11:21:41.016393Z"
                },
                "host": "all",
                "id": "34a71bf3-2429-4344-9198-9258d5679baa",
                "validation_id": "check-cpu",
                "validation_path": "/usr/share/ansible/validation-playbooks"
            },
            "tasks": []
        }
    ],
    "stats": {},
    "validation_output": []
}

(undercloud) [stack@undercloud-0 ~]$ openstack tripleo validator run --validation check-cpu --static-inventory /home/stack/inventory.yaml
Running Validations without Overcloud settings.
+--------------------------------------+-------------+--------+------------+-------------------------------------+-------------------+-------------+
|                 UUID                 | Validations | Status | Host_Group |            Status_by_Host           | Unreachable_Hosts |   Duration  |
+--------------------------------------+-------------+--------+------------+-------------------------------------+-------------------+-------------+
| 080355b9-7bab-4a2d-b275-690943507ee8 |  check-cpu  | FAILED |    all     | compute-0, controller-0, undercloud |                   | 0:00:02.758 |
+--------------------------------------+-------------+--------+------------+-------------------------------------+-------------------+-------------+
One or more validations have failed.


Steps to Reproduce:
1. Generate a static inventory from tripleo-ansible-inventory script
2. Run one validation with --static-inventory inventory.yaml (relative path) 
   - Validation will be considered as PASSED but real executation didn't happen, no duration etc...
3. Run one validation with --static-inventory /home/stack/inventory.yaml (absolute path)

Comment 2 Gaël Chamoulaud 2021-04-27 12:19:37 UTC
The patch has to be backported downstream first due to mishap on the rhos-16.1-trunk-patches.

Comment 12 Jad Haj Yahya 2021-07-28 11:29:43 UTC
Verified according to instruction above

Comment 24 errata-xmlrpc 2021-12-09 20:19: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.7 (Train) bug fix and enhancement 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:3762