Bug 1636641 - Failed introspection in OC returns 0
Summary: Failed introspection in OC returns 0
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat OpenStack
Classification: Red Hat
Component: python-ironic-inspector-client
Version: 14.0 (Rocky)
Hardware: Unspecified
OS: Unspecified
low
low
Target Milestone: Upstream M2
: 15.0 (Stein)
Assignee: Iury Gregory Melo Ferreira
QA Contact: Alistair Tonner
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-10-06 05:40 UTC by Alexander Chuzhoy
Modified: 2019-09-26 10:46 UTC (History)
8 users (show)

Fixed In Version: python-ironic-inspector-client-3.5.0-0.20190423211427.9bb1150.el8ost
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-09-21 11:19:11 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
OpenStack Storyboard 2004376 0 None None None 2018-12-06 13:49:35 UTC
OpenStack gerrit 618543 0 None None None 2018-11-16 15:26:01 UTC
OpenStack gerrit 620558 0 None None None 2018-12-06 14:18:19 UTC
Red Hat Product Errata RHEA-2019:2811 0 None None None 2019-09-21 11:19:30 UTC

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


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