TypeError thrown by six.reraise in Engine Package Loader

Bug #1632107 reported by Felipe Monteiro
12
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Murano
Fix Released
Low
Felipe Monteiro

Bug Description

A TypeError is thrown in engine.package_loader.ApiPackageLoader.load_package, when six.reraise is called following a LookupError exception being caught.

The way six.reraise is being called is:
    six.reraise(exceptions.NoPackageFound(package_name), None, exc_info[2])

This bug appears to only affect Python 3.4 environment.

The following sample stacktrace is produced:

Captured traceback:
~~~~~~~~~~~~~~~~~~~
    b'Traceback (most recent call last):'
    b' File "/opt/stack/mitaka-murano/murano/engine/package_loader.py", line 160, in load_package'
    b' package_definition = self._get_definition(filter_opts)'
    b' File "/opt/stack/mitaka-murano/murano/engine/package_loader.py", line 213, in _get_definition'
    b' raise LookupError()'
    b'LookupError'
    b''
    b'During handling of the above exception, another exception occurred:'
    b''
    b'Traceback (most recent call last):'
    b' File "/opt/stack/mitaka-murano/murano/tests/unit/engine/test_package_loader.py", line 204, in test_load_package_except_lookup_error'
    b" self.loader.load_package('test_package_name', spec)"
    b' File "/opt/stack/mitaka-murano/murano/engine/package_loader.py", line 165, in load_package'
    b' None, exc_info[2])'
    b' File "/opt/stack/mitaka-murano/.tox/py34/lib/python3.4/site-packages/six.py", line 683, in reraise'
    b' value = tp()'
    b"TypeError: 'NoPackageFound' object is not callable"
    b''

Felipe Monteiro (fm577c)
Changed in murano:
assignee: nobody → Felipe Monteiro (fm577c)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix proposed to murano (master)

Related fix proposed to branch: master
Review: https://review.openstack.org/384713

Felipe Monteiro (fm577c)
description: updated
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to murano (master)

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

Changed in murano:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to murano (master)

Reviewed: https://review.openstack.org/384714
Committed: https://git.openstack.org/cgit/openstack/murano/commit/?id=922a6fac2e25994d33a7853bd3645c4ea3df4be8
Submitter: Jenkins
Branch: master

commit 922a6fac2e25994d33a7853bd3645c4ea3df4be8
Author: Felipe Monteiro <email address hidden>
Date: Mon Oct 10 16:58:06 2016 -0400

    Fix TypeError being thrown by six.reraise in Engine Package Loader.

    Currently, six.reraise throws a TypeError in Python 3.4, because
    it is being called incorrectly in function load_package in
    package_loader.ApiPackageLoader.

    The way six.reraise is called was changed to reflect the
    "generic" way it is called throughout the rest of the file.

    Closes-Bug: #1632107

    Change-Id: Iadb9c5a6483bf779afd916ebe53852b72581b03e

Changed in murano:
status: In Progress → Fix Released
Changed in murano:
importance: Undecided → Low
milestone: none → ocata-1
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix merged to murano (master)

Reviewed: https://review.openstack.org/384713
Committed: https://git.openstack.org/cgit/openstack/murano/commit/?id=3aceb029de04b3120bc0233c84c32839e4ed3d7c
Submitter: Jenkins
Branch: master

commit 3aceb029de04b3120bc0233c84c32839e4ed3d7c
Author: Felipe Monteiro <email address hidden>
Date: Tue Oct 11 09:25:09 2016 -0400

    Increase unit test coverage for Engine Package Loader.

    Implements bp: murano-unit-test-coverage

    Related-Bug: #1632107
    Change-Id: I7cafcf0d7576980b72f2f4ed3529e3cf6508feda

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/murano 3.1.0

This issue was fixed in the openstack/murano 3.1.0 release.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix proposed to murano (master)

Related fix proposed to branch: master
Review: https://review.openstack.org/435101

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix merged to murano (master)

Reviewed: https://review.openstack.org/435101
Committed: https://git.openstack.org/cgit/openstack/murano/commit/?id=f59f3ba565329748a86b937533a2d2cfc079fe1d
Submitter: Jenkins
Branch: master

commit f59f3ba565329748a86b937533a2d2cfc079fe1d
Author: Felipe Monteiro <email address hidden>
Date: Thu Feb 16 15:19:44 2017 -0500

    Remove skip test from murano engine package loader unit test.

    Removes the @testtools.skipIf decorator from
    test_load_package_except_lookup_error in
    murano.unit.tests.engine.test_package_loader, because related bug was
    removed [1].

    This patch makes a trivial change by removing the skip.

    [1] https://review.openstack.org/#/c/384713/

    Change-Id: I86cfe4cedd63b0224fcc0186cdba671bb91004e9
    Related-Bug: #1632107

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

Duplicates of this bug

Other bug subscribers

Remote bug watches

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