new version of construct lib breaks exception handling

Bug #1745208 reported by Bob Fournier
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Ironic Inspector
Fix Released
Undecided
Bob Fournier

Bug Description

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.

Bob Fournier (bfournie)
Changed in ironic-inspector:
assignee: nobody → Bob Fournier (bfournie)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to ironic-inspector (master)

Fix proposed to branch: master
Review: https://review.openstack.org/537627

Changed in ironic-inspector:
status: New → In Progress
Revision history for this message
Bob Fournier (bfournie) wrote :

See https://github.com/construct/construct/issues/453 for discussion of the construct change in 2.8.22.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to ironic-inspector (master)

Reviewed: https://review.openstack.org/537627
Committed: https://git.openstack.org/cgit/openstack/ironic-inspector/commit/?id=a6f2805bbc2d51918a027ca519ada793cb6c9cf9
Submitter: Zuul
Branch: master

commit a6f2805bbc2d51918a027ca519ada793cb6c9cf9
Author: Bob Fournier <email address hidden>
Date: Wed Jan 24 14:35:09 2018 -0500

    Remove use of construct lib FieldError exception

    Version 2.8.22 of the construct lib has introduced a change that
    removed the core.FieldError exception. The check now uses the
    parent exception - core.ConstructError.

    Change-Id: I31922c2afc2018a4f6f7ba48094388070537a13f
    Closes-Bug: 1745208

Changed in ironic-inspector:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to ironic-inspector (stable/pike)

Fix proposed to branch: stable/pike
Review: https://review.openstack.org/540619

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to ironic-inspector (stable/pike)

Reviewed: https://review.openstack.org/540619
Committed: https://git.openstack.org/cgit/openstack/ironic-inspector/commit/?id=c5c460eac0d27e945f4cd2cc305b47ed62b6eada
Submitter: Zuul
Branch: stable/pike

commit c5c460eac0d27e945f4cd2cc305b47ed62b6eada
Author: Bob Fournier <email address hidden>
Date: Wed Jan 24 14:35:09 2018 -0500

    Remove use of construct lib FieldError exception

    Version 2.8.22 of the construct lib has introduced a change that
    removed the core.FieldError exception. The check now uses the
    parent exception - core.ConstructError.

    Change-Id: I31922c2afc2018a4f6f7ba48094388070537a13f
    Closes-Bug: 1745208
    (cherry picked from commit a6f2805bbc2d51918a027ca519ada793cb6c9cf9)

tags: added: in-stable-pike
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to ironic-inspector (stable/ocata)

Fix proposed to branch: stable/ocata
Review: https://review.openstack.org/541271

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/ironic-inspector 7.1.0

This issue was fixed in the openstack/ironic-inspector 7.1.0 release.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to ironic-inspector (stable/ocata)

Reviewed: https://review.openstack.org/541271
Committed: https://git.openstack.org/cgit/openstack/ironic-inspector/commit/?id=53f44a7ccf8164d19031266a35e341cc557ee84a
Submitter: Zuul
Branch: stable/ocata

commit 53f44a7ccf8164d19031266a35e341cc557ee84a
Author: Bob Fournier <email address hidden>
Date: Wed Jan 24 14:35:09 2018 -0500

    Remove use of construct lib FieldError exception

    Version 2.8.22 of the construct lib has introduced a change that
    removed the core.FieldError exception. The check now uses the
    parent exception - core.ConstructError.

    Change-Id: I31922c2afc2018a4f6f7ba48094388070537a13f
    Closes-Bug: 1745208
    (cherry picked from commit a6f2805bbc2d51918a027ca519ada793cb6c9cf9)

tags: added: in-stable-ocata
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/ironic-inspector 5.0.2

This issue was fixed in the openstack/ironic-inspector 5.0.2 release.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/ironic-inspector 6.0.1

This issue was fixed in the openstack/ironic-inspector 6.0.1 release.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.