Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 1927196

Summary: [Validator Run] Add return code management
Product: Red Hat OpenStack Reporter: Gaël Chamoulaud <gchamoul>
Component: python-tripleoclientAssignee: Gaël Chamoulaud <gchamoul>
Status: CLOSED ERRATA QA Contact: David Rosenfeld <drosenfe>
Severity: high Docs Contact:
Priority: high    
Version: 16.1 (Train)CC: hbrock, jslagle, mburns, slinaber
Target Milestone: z6Keywords: Triaged
Target Release: 16.1 (Train on RHEL 8.2)   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: python-tripleoclient-12.3.2-1.20201114043249.el8ost Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-05-26 13:51:28 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-02-10 10:36:20 UTC
Hi,

context: we trying to add validation to the update process, but the validation command doesn't fail even if the the test fails:

undercloud-0 tripleo-validations]$ openstack --os-cloud undercloud tripleo validator run --stack undercloud --group pre-system-upgrade
[WARNING]: Found both group and host with same name: undercloud
Tuesday 09 February 2021 13:59:25 +0000 (0:00:00.063) 0:00:00.063 ******
Tuesday 09 February 2021 13:59:26 +0000 (0:00:00.771) 0:00:00.834 ******
Tuesday 09 February 2021 13:59:26 +0000 (0:00:00.112) 0:00:00.947 ******
Tuesday 09 February 2021 13:59:30 +0000 (0:00:03.507) 0:00:04.454 ******
Tuesday 09 February 2021 13:59:30 +0000 (0:00:00.062) 0:00:04.516 ******
Tuesday 09 February 2021 13:59:30 +0000 (0:00:00.118) 0:00:04.635 ******
Tuesday 09 February 2021 13:59:30 +0000 (0:00:00.110) 0:00:04.746 ******
Tuesday 09 February 2021 13:59:30 +0000 (0:00:00.169) 0:00:04.915 ******

Tuesday 09 February 2021 13:59:30 +0000 (0:00:00.111) 0:00:05.027 ******
===============================================================================
package_version : Get repositories packages versions -------------------- 3.51s
package_version : Ensure we get needed facts ---------------------------- 0.77s
package_version : Do the comparison ------------------------------------- 0.17s
package_version : Compare versions -------------------------------------- 0.12s
package_version : Gather variables for each operating system ------------ 0.11s
package_version : Fail if we lack a version for any package ------------- 0.11s
package_version : Get wanted package ------------------------------------ 0.11s
package_version : Initialiaze ok_versions ------------------------------- 0.06s
+--------------------------------------+-----------------+--------+------------+----------------+-------------------+-------------+
| UUID | Validations | Status | Host_Group | Status_by_Host | Unreachable_Hosts | Duration |
+--------------------------------------+-----------------+--------+------------+----------------+-------------------+-------------+
| dc8ee383-7653-43c1-abee-eaeabe3ec37b | package-version | FAILED | all | undercloud | | 0:00:04.977 |
+--------------------------------------+-----------------+--------+------------+----------------+-------------------+-------------+

echo $?
0

The question is then what is the proper way to detect that a validation failed ?

Comment 7 David Rosenfeld 2021-04-16 20:58:26 UTC
Return code is now seen:

openstack tripleo validator run --validation overcloud-service-status
Running Validations without Overcloud settings.
+--------------------------------------+--------------------------+--------+------------+----------------+-------------------+-------------+
|                 UUID                 |       Validations        | Status | Host_Group | Status_by_Host | Unreachable_Hosts |   Duration  |
+--------------------------------------+--------------------------+--------+------------+----------------+-------------------+-------------+
| 976ad362-07bd-4b2d-9219-a4177b00e32e | overcloud-service-status | FAILED | Undercloud |   undercloud   |                   | 0:00:32.542 |
+--------------------------------------+--------------------------+--------+------------+----------------+-------------------+-------------+
One or more validations have failed.
(undercloud) [stack@undercloud-0 ~]$ echo $?
1
(undercloud) [stack@undercloud-0 ~]$

Comment 14 errata-xmlrpc 2021-05-26 13:51:28 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.6 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:2097