Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 1543006 - new version of construct lib breaks Ironic Inspector exception handling
new version of construct lib breaks Ironic Inspector exception handling
Status: CLOSED ERRATA
Product: Red Hat OpenStack
Classification: Red Hat
Component: openstack-ironic-inspector (Show other bugs)
13.0 (Queens)
Unspecified Unspecified
high Severity high
: beta
: 13.0 (Queens)
Assigned To: Bob Fournier
mlammon
: Triaged
Depends On:
Blocks: 1543009 1543015
  Show dependency treegraph
 
Reported: 2018-02-07 09:57 EST by Bob Fournier
Modified: 2018-06-27 09:45 EDT (History)
3 users (show)

See Also:
Fixed In Version: openstack-ironic-inspector-7.2.0-0.20180217115157.a8d621f.el7ost
Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1543009 1543015 (view as bug list)
Environment:
Last Closed: 2018-06-27 09:43:30 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
Launchpad 1745208 None None None 2018-02-07 09:57 EST
OpenStack gerrit 537627 None master: MERGED ironic-inspector: Remove use of construct lib FieldError exception (I31922c2afc2018a4f6f7ba48094388070537a13f) 2018-02-28 08:53 EST
Red Hat Product Errata RHEA-2018:2086 None None None 2018-06-27 09:45 EDT

  None (edit)
Description Bob Fournier 2018-02-07 09:57:36 EST
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 6 mlammon 2018-05-09 10:51:23 EDT
Installed latest osp 13 

Verified the code in in this release.  This is best we can do to verify.

Env:
openstack-ironic-inspector-7.2.1-0.20180409163359.2435d97.el7ost.noarch

In   /usr/lib/python2.7/site-packages/ironic_inspector/plugins/local_link_connection.py

          # Only accept mac address for chassis ID
            if (item == SWITCH_ID_ITEM_NAME and
                    not netutils.is_valid_mac(value)):
                LOG.info("Skipping switch_id since it's not a MAC: %s", value,
                         node_info=node_info)
                return
Comment 8 errata-xmlrpc 2018-06-27 09:43:30 EDT
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-2018:2086

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