Bug 1926721

Summary: Refactoring and overall improvement of check-latest-packages-version validation
Product: Red Hat OpenStack Reporter: Gaël Chamoulaud <gchamoul>
Component: validations-commonAssignee: Jiri Podivin <jpodivin>
Status: CLOSED ERRATA QA Contact: David Rosenfeld <drosenfe>
Severity: medium Docs Contact:
Priority: medium    
Version: 16.2 (Train)CC: drosenfe, jpodivin, nlevinki
Target Milestone: rcKeywords: Triaged
Target Release: 16.2 (Train on RHEL 8.4)   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: validations-common-1.1.2-2.20210424004734.8d6e8d4.el8ost Doc Type: Enhancement
Doc Text:
This enhancement improves the performance and application of the `check-latest-packages-version` validation.
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-09-15 07:11:47 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: 1926238    
Bug Blocks: 1944079    

Description Gaël Chamoulaud 2021-02-09 10:45:40 UTC
This validation tests by default if the python*-tripleoclient package is not up2date on the Undercloud. That validation is hosted in validations-common which should contain non-tripleo validation.

This validation should be generic and not containing tripleo references.

Comment 4 Jiri Podivin 2021-03-29 10:19:47 UTC
*** Bug 1944079 has been marked as a duplicate of this bug. ***

Comment 5 Jiri Podivin 2021-04-26 06:58:00 UTC
Patch in build: https://brewweb.engineering.redhat.com/brew/buildinfo?buildID=1586887

Comment 9 Jiri Podivin 2021-05-21 07:37:12 UTC
You can test this by running the tripleo-latest-packages-version validation. As it wraps around this module.

Comment 10 David Rosenfeld 2021-05-24 13:43:49 UTC
Got checking a single package to work:

openstack tripleo validator run --validation check-latest-packages-version --extra-vars packages_list=openstack-tripleo-heat-templates
Running Validations without Overcloud settings.
+--------------------------------------+-------------------------------+--------+------------+----------------+-------------------+-------------+
| UUID                                 | Validations                   | Status | Host_Group | Status_by_Host | Unreachable_Hosts | Duration    |
+--------------------------------------+-------------------------------+--------+------------+----------------+-------------------+-------------+
| 6523932e-607d-4564-a5f5-254048fe6088 | check-latest-packages-version | PASSED | localhost  | localhost      |                   | 0:00:02.853 |
+--------------------------------------+-------------------------------+--------+------------+----------------+-------------------+-------------+

but couldn't get checking multiple packages to work:

openstack tripleo validator run --validation check-latest-packages-version --extra-vars packages_list=openstack-tripleo-heat-templates,openstack-tripleo-common
Expected comma separated 'key=value' pairs, but got: openstack-tripleo-common

Moving back to on_dev

Comment 11 Jiri Podivin 2021-05-24 14:48:56 UTC
Deploying the puddle on DF-5 to see if there is a way to do this without rewrite. 
Afterwards I'll update the BZ with instructions for the validation, as well as a new code (if needed).

Comment 12 Jiri Podivin 2021-05-24 16:06:52 UTC
To test the validation with multiple packages one has to supply the list of packages for the validation to check.
At this time, this can be accomplished with the `--extra-vars-file` argument, and supplying it with a yaml file containing list of the packages.

For example:
"""
---
packages_list:
 - openstack-tripleo-heat-templates
 - openstack-tripleo-common
 ...

"""

If the file is named extra_vars.yaml, the command would be, assuming the stack user on the undercloud:

`openstack tripleo validator run --validation check-latest-packages-version --extra-vars-file=extra_vars.yaml`


At this time I'm not sure how to properly supply a list trough the `--extra-vars` argument.
In my opinion it would be rather unwieldy if possible at all.

Comment 13 David Rosenfeld 2021-05-24 18:50:30 UTC
Using procedure from comment 12 with an extra-vars-file could validate multiple packages. Moving to Verified.

Comment 15 errata-xmlrpc 2021-09-15 07:11:47 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 (RHOSP) 16.2 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/RHEA-2021:3483