unit tests failing with RuntimeError: Release icehouse is not a known OpenStack release

Bug #1693017 reported by Ryan Beisner on 2017-05-23
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack AODH Charm
Undecided
Unassigned
OpenStack Barbican Charm
Undecided
Unassigned
OpenStack Designate-Bind Charm
Undecided
Unassigned
OpenStack Keystone LDAP integration
Undecided
Unassigned
charms.openstack
Undecided
Alex Kavanagh

Bug Description

RuntimeError: Release icehouse is not a known OpenStack release

During a rebuild and re-test of the existing charm repo, the following unit test failure is encountered:

2017-05-23 19:59:37.016863 | Failed to import test module: unit_tests.test_lib_charm_openstack_designate_bind
2017-05-23 19:59:37.016886 | Traceback (most recent call last):
2017-05-23 19:59:37.016940 | File "/home/jenkins/workspace/gate-charm-designate-bind-python35/.tox/py35/lib/python3.5/site-packages/unittest2/loader.py", line 456, in _find_test_path
2017-05-23 19:59:37.016964 | module = self._get_module_from_name(name)
2017-05-23 19:59:37.017019 | File "/home/jenkins/workspace/gate-charm-designate-bind-python35/.tox/py35/lib/python3.5/site-packages/unittest2/loader.py", line 395, in _get_module_from_name
2017-05-23 19:59:37.017037 | __import__(name)
2017-05-23 19:59:37.017087 | File "/home/jenkins/workspace/gate-charm-designate-bind-python35/unit_tests/test_lib_charm_openstack_designate_bind.py", line 22, in <module>
2017-05-23 19:59:37.017117 | import charm.openstack.designate_bind as designate_bind
2017-05-23 19:59:37.017159 | File "src/lib/charm/openstack/designate_bind.py", line 203, in <module>
2017-05-23 19:59:37.017189 | class DesignateBindCharm(openstack_charm.OpenStackCharm):
2017-05-23 19:59:37.017242 | File "/home/jenkins/workspace/gate-charm-designate-bind-python35/.tox/py35/lib/python3.5/site-packages/charms_openstack/charm.py", line 446, in __init__
2017-05-23 19:59:37.017260 | .format(release))
2017-05-23 19:59:37.017288 | RuntimeError: Release icehouse is not a known OpenStack release

Ryan Beisner (1chb1n) on 2017-05-23
description: updated
Ryan Beisner (1chb1n) wrote :

A barbican test @ master fails in a similar way:

Failed to import test module: unit_tests.test_barbican_handlers
Traceback (most recent call last):
  File "/home/rbeisner/git/charm-barbican/.tox/py35/lib/python3.5/site-packages/unittest2/loader.py", line 456, in _find_test_path
    module = self._get_module_from_name(name)
  File "/home/rbeisner/git/charm-barbican/.tox/py35/lib/python3.5/site-packages/unittest2/loader.py", line 395, in _get_module_from_name
    __import__(name)
  File "/home/rbeisner/git/charm-barbican/unit_tests/test_barbican_handlers.py", line 20, in <module>
    import reactive.barbican_handlers as handlers
  File "src/reactive/barbican_handlers.py", line 25, in <module>
    import charm.openstack.barbican as barbican # noqa
  File "src/lib/charm/openstack/barbican.py", line 114, in <module>
    class BarbicanCharm(charms_openstack.charm.HAOpenStackCharm):
  File "/home/rbeisner/git/charm-barbican/.tox/py35/lib/python3.5/site-packages/charms_openstack/charm.py", line 446, in __init__
    .format(release))
RuntimeError: Release mitaka is not a known OpenStack release

Ryan Beisner (1chb1n) wrote :

Likewise, aodh @ master:

Failed to import test module: unit_tests.test_aodh_handlers
Traceback (most recent call last):
  File "/home/rbeisner/git/charm-aodh/.tox/py35/lib/python3.5/site-packages/unittest2/loader.py", line 456, in _find_test_path
    module = self._get_module_from_name(name)
  File "/home/rbeisner/git/charm-aodh/.tox/py35/lib/python3.5/site-packages/unittest2/loader.py", line 395, in _get_module_from_name
    __import__(name)
  File "/home/rbeisner/git/charm-aodh/unit_tests/test_aodh_handlers.py", line 22, in <module>
    import reactive.aodh_handlers as handlers
  File "src/reactive/aodh_handlers.py", line 19, in <module>
    import charm.openstack.aodh as aodh
  File "src/lib/charm/openstack/aodh.py", line 49, in <module>
    class AodhCharm(charms_openstack.charm.HAOpenStackCharm):
  File "/home/rbeisner/git/charm-aodh/.tox/py35/lib/python3.5/site-packages/charms_openstack/charm.py", line 446, in __init__
    .format(release))
RuntimeError: Release mitaka is not a known OpenStack release

Ryan Beisner (1chb1n) wrote :

This will block future reviews of reactive openstack charms/layers/interfaces from landing until resolved.

Ryan Beisner (1chb1n) wrote :

Repro with: tox -e py35

Alex Kavanagh (ajkavanagh) wrote :

I have a fix here: https://review.openstack.org/#/c/467131/ for this bug. However, it needs two other charms.openstack changes to land, but this should happen shortly. I'll tag this bug in an updated review for the above change. However, each charm will need to be changed to call the mocking function, so this affects:

aodh, barbican, barbican-softhsm, designate, manila, manila-generic, tempest

and anything else that uses charms.openstack. Obviously, this doesn't affect build charms.

Changed in charms.openstack:
status: New → In Progress

Reviewed: https://review.openstack.org/467131
Committed: https://git.openstack.org/cgit/openstack/charms.openstack/commit/?id=580ae528bee423a385ca51e7c83b43a7b2d0becf
Submitter: Jenkins
Branch: master

commit 580ae528bee423a385ca51e7c83b43a7b2d0becf
Author: Alex Kavanagh <email address hidden>
Date: Tue May 23 11:58:03 2017 +0100

    Add a test_mocks to mock charmhelpers centrally

    Every reactive charm that uses charms.openstack and implements
    unit testing needs to mock charmhelpers, as otherwise the tests
    blow up. This patch centralises the mocking of charmhelpers to
    charms.openstack so that a charm layer can just import test_mocks
    and charmhelpers will be mocked out along with setting up a default
    charmhelpers.c.o.u.OPENSTACK_RELEASES so that when an OpenStackCharm()
    derived charm class won't fail on definition.

    Closes-Bug: #1693017
    Change-Id: I5ac40617ee30e5f421ec16fc7592177a5e6aa166

Changed in charms.openstack:
status: In Progress → Fix Released

Reviewed: https://review.openstack.org/467725
Committed: https://git.openstack.org/cgit/openstack/charm-aodh/commit/?id=d9c11f6525d22b7262e8a1203f08a6491043f151
Submitter: Jenkins
Branch: master

commit d9c11f6525d22b7262e8a1203f08a6491043f151
Author: Alex Kavanagh <email address hidden>
Date: Wed May 24 20:23:38 2017 +0100

    Use charms.openstack charmhelpers test_mocks

    Every reactive charm that uses charms.openstack and implements unit
    testing needs to mock charmhelpers, as otherwise the tests blow up.
    This patch uses the mocking of charmhelpers in charms.openstack so that
    a charm layer can just import test_mocks and charmhelpers will be mocked
    out along with setting up a default
    charmhelpers.c.o.u.OPENSTACK_RELEASES so that when an OpenStackCharm()
    derived charm class won't fail on definition.

    Change-Id: I703f7cc775a78cf3b56583316c3dcb8482751bfd
    Related-Bug: #1693017
    Depends-On: I5ac40617ee30e5f421ec16fc7592177a5e6aa166

Reviewed: https://review.openstack.org/467735
Committed: https://git.openstack.org/cgit/openstack/charm-barbican/commit/?id=8c8569922b209b9dc02de84e0f4e2f5ee1eb7aea
Submitter: Jenkins
Branch: master

commit 8c8569922b209b9dc02de84e0f4e2f5ee1eb7aea
Author: Alex Kavanagh <email address hidden>
Date: Wed May 24 20:44:33 2017 +0100

    Use charms.openstack charmhelpers test_mocks

    Every reactive charm that uses charms.openstack and implements unit
    testing needs to mock charmhelpers, as otherwise the tests blow up.
    This patch uses the mocking of charmhelpers in charms.openstack so that
    a charm layer can just import test_mocks and charmhelpers will be mocked
    out along with setting up a default
    charmhelpers.c.o.u.OPENSTACK_RELEASES so that when an OpenStackCharm()
    derived charm class won't fail on definition.

    Change-Id: I294e20e383e3372dfe61d2c86424776d3e060811
    Related-Bug: #1693017
    Depends-On: I5ac40617ee30e5f421ec16fc7592177a5e6aa166

Reviewed: https://review.openstack.org/467970
Committed: https://git.openstack.org/cgit/openstack/charm-designate-bind/commit/?id=5317a5d41f84d3711dd1ae0661ce7d74e6a61886
Submitter: Jenkins
Branch: master

commit 5317a5d41f84d3711dd1ae0661ce7d74e6a61886
Author: Alex Kavanagh <email address hidden>
Date: Thu May 25 11:02:28 2017 +0100

    Use charms.openstack charmhelpers test_mocks

    Every reactive charm that uses charms.openstack and implements unit
    testing needs to mock charmhelpers, as otherwise the tests blow up.
    This patch uses the mocking of charmhelpers in charms.openstack so that
    a charm layer can just import test_mocks and charmhelpers will be mocked
    out along with setting up a default
    charmhelpers.c.o.u.OPENSTACK_RELEASES so that when an OpenStackCharm()
    derived charm class won't fail on definition.

    Change-Id: Ia9744ea95f0766769daa8e8c31d422ee79c3afc5
    Related-Bug: #1693017
    Depends-On: I5ac40617ee30e5f421ec16fc7592177a5e6aa166

Changed in charm-aodh:
status: New → Fix Committed
Changed in charm-barbican:
status: New → Fix Committed
Changed in charm-designate-bind:
status: New → Fix Committed

Change abandoned by Frode Nordahl (<email address hidden>) on branch: master
Review: https://review.openstack.org/471798
Reason: David incorporated this fix into https://review.openstack.org/#/c/442725/

Changed in charms.openstack:
assignee: nobody → Alex Kavanagh (ajkavanagh)
Alex Kavanagh (ajkavanagh) wrote :

I've checked keystone-ldap and it's been fixed as of the "Enable Zesty-Ocata Amulet Tests" (commit 7a1d9eb3f853b7b32aa9b429285bd9ec512198e4, Change-Id: Id3cbb8944e559ddb57dd249274572d264183f56f)

Changed in charm-keystone-ldap:
status: New → Fix Committed
James Page (james-page) on 2017-09-06
Changed in charm-designate-bind:
milestone: none → 17.08
Changed in charm-barbican:
milestone: none → 17.08
Changed in charm-aodh:
milestone: none → 17.08
Changed in charm-keystone-ldap:
milestone: none → 17.08
James Page (james-page) on 2017-09-12
Changed in charm-designate-bind:
status: Fix Committed → Fix Released
Changed in charm-barbican:
status: Fix Committed → Fix Released
Changed in charm-aodh:
status: Fix Committed → Fix Released
Changed in charm-keystone-ldap:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers