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
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?
If we could use it in automation - good enough for me. Thanks.
(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 $?
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