Bug 1927196 - [Validator Run] Add return code management
Summary: [Validator Run] Add return code management
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat OpenStack
Classification: Red Hat
Component: python-tripleoclient
Version: 16.1 (Train)
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: z6
: 16.1 (Train on RHEL 8.2)
Assignee: Gaël Chamoulaud
QA Contact: David Rosenfeld
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-02-10 10:36 UTC by Gaël Chamoulaud
Modified: 2022-08-26 15:27 UTC (History)
4 users (show)

Fixed In Version: python-tripleoclient-12.3.2-1.20201114043249.el8ost
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2021-05-26 13:51:28 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
OpenStack gerrit 757820 0 None MERGED [Validator Run] Add return code management 2021-02-15 11:16:33 UTC
OpenStack gerrit 774691 0 None MERGED [Validator Run] Add return code management 2021-02-15 11:16:33 UTC
OpenStack gerrit 774692 0 None MERGED [Validator Run] Add return code management 2021-03-26 10:04:06 UTC
OpenStack gerrit 774697 0 None MERGED [Validator Run] Add return code management 2021-02-15 11:16:33 UTC
Red Hat Issue Tracker OSP-1972 0 None None None 2022-08-26 15:27:46 UTC
Red Hat Product Errata RHBA-2021:2097 0 None None None 2021-05-26 13:51:57 UTC

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


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