Bug 1543015 - new version of construct lib breaks Ironic Inspector exception handling (OSP11)
Summary: new version of construct lib breaks Ironic Inspector exception handling (OSP11)
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat OpenStack
Classification: Red Hat
Component: openstack-ironic-inspector
Version: 11.0 (Ocata)
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: z5
: 11.0 (Ocata)
Assignee: Bob Fournier
QA Contact: mlammon
URL:
Whiteboard:
Depends On: 1543006
Blocks: 1543009
TreeView+ depends on / blocked
 
Reported: 2018-02-07 15:05 UTC by Bob Fournier
Modified: 2018-05-18 17:14 UTC (History)
5 users (show)

Fixed In Version: openstack-ironic-inspector-5.0.2-2.el7ost
Doc Type: If docs needed, set a value
Doc Text:
Clone Of: 1543006
Environment:
Last Closed: 2018-05-18 17:14:29 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Launchpad 1745208 0 None None None 2018-02-07 15:05:03 UTC
OpenStack gerrit 541271 0 None None None 2018-02-07 15:05:03 UTC
Red Hat Product Errata RHBA-2018:1618 0 None None None 2018-05-18 17:14:45 UTC

Description Bob Fournier 2018-02-07 15:05:04 UTC
+++ This bug was initially created as a clone of Bug #1543006 +++

Description of problem:

Version 2.8.22 of construct has introduced a change to the core exception handling. The FieldError exception is no longer supported. As ironic-inspector was handling this exception explicitly it results in the following ironic-inspector test failures.

ironic_inspector.test.unit.test_plugins_lldp_basic.TestLLDPBasicProcessingHook.test_invalid_ip
----------------------------------------------------------------------------------------------

Captured traceback:
~~~~~~~~~~~~~~~~~~~
    Traceback (most recent call last):
      File "/home/bfournie/workspace/ironic-inspector/.tox/py3/lib/python2.7/site-packages/mock/mock.py", line 1305, in patched
        return func(*args, **keywargs)
      File "ironic_inspector/test/unit/test_plugins_lldp_basic.py", line 288, in test_invalid_ip
        self.hook.before_update(self.data, self.node_info)
      File "ironic_inspector/plugins/lldp_basic.py", line 82, in before_update
        nv = self._parse_lldp_tlvs(tlvs, node_info)
      File "ironic_inspector/plugins/lldp_basic.py", line 56, in _parse_lldp_tlvs
        if parser.parse_tlv(tlv_type, data):
      File "ironic_inspector/common/lldp_parsers.py", line 158, in parse_tlv
        except (core.RangeError, core.FieldError, core.MappingError,
    AttributeError: 'module' object has no attribute 'FieldError'

The explicit exception handling on parsing the lldp data is not required and this should be replaced by a general exception handler.

Version-Release number of selected component (if applicable):

How reproducible:

Every time introspection is run when using Version 2.8.22 of construct lib.

Steps to Reproduce:
1. Import baremetal node connected to network switch running lldp
2. Run introspection

Actual results:

Introspection fails with error as above.

Expected results:

Introspection passes.


Additional info:

Comment 2 mlammon 2018-05-09 16:54:50 UTC
install latest osp 11 puddle: 2018-05-03.2

Env
[stack@undercloud-0 ~]$ rpm -qa | grep openstack-ironic-inspector
openstack-ironic-inspector-5.0.2-2.el7ost.noarch

Introspection successful:
openstack baremetal introspection status controller-0
+-------------+--------------------------------------+
| Field       | Value                                |
+-------------+--------------------------------------+
| error       | None                                 |
| finished    | True                                 |
| finished_at | 2018-05-09T14:15:10                  |
| started_at  | 2018-05-09T14:13:08                  |
| uuid        | 0ddfdc9a-26b8-4593-815f-61fd9f58cdbf |
+-------------+--------------------------------------+

Comment 5 errata-xmlrpc 2018-05-18 17:14:29 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/RHBA-2018:1618


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