Bug 1636641

Summary: Failed introspection in OC returns 0
Product: Red Hat OpenStack Reporter: Alexander Chuzhoy <sasha>
Component: python-ironic-inspector-clientAssignee: Iury Gregory Melo Ferreira <imelofer>
Status: CLOSED ERRATA QA Contact: Alistair Tonner <atonner>
Severity: low Docs Contact:
Priority: low    
Version: 14.0 (Rocky)CC: atonner, bfournie, jjoyce, jschluet, mburns, sasha, slinaber, tvignaud
Target Milestone: Upstream M2Keywords: Triaged, ZStream
Target Release: 15.0 (Stein)   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: python-ironic-inspector-client-3.5.0-0.20190423211427.9bb1150.el8ost Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-09-21 11:19: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:

Description Alexander Chuzhoy 2018-10-06 05:40:44 UTC
Failed introspection in OC returns 0

Environment:
puppet-ironic-13.3.1-0.20180911185738.317a1e5.el7ost.noarch
python-ironic-lib-2.14.0-0.20180810074837.344161b.el7ost.noarch
python2-ironicclient-2.5.0-0.20180810135843.fb94fb8.el7ost.noarch
python2-ironic-inspector-client-3.3.0-0.20180810080932.53bf4e8.el7ost.noarch
openstack-ironic-common-11.1.1-0.20180919150343.f1e7f95.el7ost.noarch


Steps to reproduce:
(overcloud) [stack@undercloud-0 ~]$ time openstack baremetal introspection start --wait ironic-1
Waiting for introspection to finish...
echo $?
+----------+-----------------------+
| UUID     | Error                 |
+----------+-----------------------+
| ironic-1 | Introspection timeout |
+----------+-----------------------+

real    60m25.883s
user    0m1.843s
sys     0m0.310s
(overcloud) [stack@undercloud-0 ~]$ echo $?
0




Expected result:
not 0

Comment 1 Dmitry Tantsur 2018-10-24 14:57:51 UTC
So, I have realized it's a bit less straightforward than I thought.. As you see, the command return the result of introspection(s), and cliff (the CLI library we use) cannot return non-zero code at the same time. What I suggest is a flag similar to 'grep -q' that will not output anything, but will output the correct error code. WDYT?

Comment 2 Alexander Chuzhoy 2018-10-24 15:09:01 UTC
If we could use it in automation - good enough for me.
Thanks.

Comment 6 Alistair Tonner 2019-07-17 18:58:30 UTC
(undercloud) [stack@undercloud-0 ~]$ openstack baremetal introspection start --wait compute-1
Invalid provision state for introspection: "active", valid states are "['inspecting', 'inspect wait', 'inspect failed', 'manageable', 'enroll']"
(undercloud) [stack@undercloud-0 ~]$ echo $?
1
(undercloud) [stack@undercloud-0 ~]$


(undercloud) [stack@undercloud-0 ~]$ openstack baremetal introspection start --wait ironic-1
Node ironic-1 was not found in Ironic
(undercloud) [stack@undercloud-0 ~]$ echo $?

Comment 8 errata-xmlrpc 2019-09-21 11:19: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, 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-2019:2811