the tests for this charm can't be run on Focal

Bug #1861659 reported by Chris MacNaughton
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Ceph Monitor Charm
Fix Released
Undecided
Chris MacNaughton
Ceph OSD Charm
Fix Released
Undecided
Chris MacNaughton
charms.ceph
Fix Released
Undecided
Chris MacNaughton

Bug Description

the unit tests end up doing an import time Version detection which breaks when charmhelpers doesn't understand the running series.

Traceback (most recent call last):
  File "/usr/lib/python3.7/unittest/loader.py", line 436, in _find_test_path
    module = self._get_module_from_name(name)
  File "/usr/lib/python3.7/unittest/loader.py", line 377, in _get_module_from_name
    __import__(name)
  File "/home/chris/code/canonical/charms/ceph-mon/unit_tests/test_upgrade.py", line 2, in <module>
    from ceph_hooks import check_for_upgrade
  File "hooks/ceph_hooks.py", line 25, in <module>
    import ceph.utils as ceph
  File "lib/ceph/utils.py", line 83, in <module>
    if CompareHostReleases(lsb_release()['DISTRIB_CODENAME']) >= 'eoan':
  File "hooks/charmhelpers/core/strutils.py", line 95, in __init__
    .format(item, self._list))
KeyError: "Item 'focal' is not in list '('lucid', 'maverick', 'natty', 'oneiric', 'precise', 'quantal', 'raring', 'saucy', 'trusty', 'utopic', 'vivid', 'wily', 'xenial', 'yakkety', 'zesty', 'artful', 'bionic', 'cosmic', 'disco', 'eoan')'"

Changed in charm-ceph-mon:
assignee: nobody → Chris MacNaughton (chris.macnaughton)
Changed in charm-ceph-osd:
assignee: nobody → Chris MacNaughton (chris.macnaughton)
Changed in charms.ceph:
assignee: nobody → Chris MacNaughton (chris.macnaughton)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to charms.ceph (master)

Reviewed: https://review.opendev.org/705169
Committed: https://git.openstack.org/cgit/openstack/charms.ceph/commit/?id=0434024b2b84e7eea6462ad6f8468827c73defdd
Submitter: Zuul
Branch: master

commit 0434024b2b84e7eea6462ad6f8468827c73defdd
Author: Chris MacNaughton <email address hidden>
Date: Fri Jan 31 08:38:47 2020 +0100

    Fix charms.ceph mocks to not depend on system version

    The charms.ceph utils.py library defines a constant based
    on the running OS version. This change updates where the
    version is read, allowing it to be nicely mocked.

    Change-Id: Ibd65526cad0812f93963bd82619fcd27e055f6f3
    Closes-Bug: #1861659

Changed in charms.ceph:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on charm-ceph-mon (master)

Change abandoned by Chris MacNaughton (icey) (<email address hidden>) on branch: master
Review: https://review.opendev.org/705388
Reason: Failed to merge, resolved elsewhere

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on charm-ceph-osd (master)

Change abandoned by Chris MacNaughton (icey) (<email address hidden>) on branch: master
Review: https://review.opendev.org/705389
Reason: Failed to merge and resolved elsewhere

Changed in charm-ceph-mon:
status: In Progress → Fix Committed
Changed in charm-ceph-osd:
status: In Progress → Fix Committed
Changed in charm-ceph-mon:
milestone: none → 20.05
Changed in charm-ceph-osd:
milestone: none → 20.05
David Ames (thedac)
Changed in charm-ceph-mon:
status: Fix Committed → Fix Released
Changed in charm-ceph-osd:
status: Fix Committed → Fix Released
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.