unit tests don't pass due to c-h sync bringing in 'apt' compatibility

Bug #1847613 reported by Alex Kavanagh
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Ceph-Proxy Charm
Fix Released
Undecided
Unassigned

Bug Description

Essentially, the types have changed a bit, and so the compatibility isn't exact. Ought to fix this in c-h, but will patch in ceph-proxy:

unit_tests.test_ceph_hooks.TestHooks.test_client_relation_joined
----------------------------------------------------------------

Captured traceback:
~~~~~~~~~~~~~~~~~~~
    b'Traceback (most recent call last):'
    b' File "/home/alex/Projects/Canonical/git/opendev.org/openstack/charm-ceph-proxy/hooks/ceph.py", line 89, in get_version'
    b' pkg = cache[package]'
    b' File "/home/alex/Projects/Canonical/git/opendev.org/openstack/charm-ceph-proxy/charmhelpers/fetch/ubuntu_apt_pkg.py", line 71, in __getitem__'
    b' apt_result = self._apt_cache_show([package])[package]'
    b' File "/home/alex/Projects/Canonical/git/opendev.org/openstack/charm-ceph-proxy/charmhelpers/fetch/ubuntu_apt_pkg.py", line 162, in _apt_cache_show'
    b" if line.startswith(' '):"
    b'TypeError: startswith first arg must be bytes or a tuple of bytes, not str'
    b''
    b'During handling of the above exception, another exception occurred:'
    b''
    b'Traceback (most recent call last):'
    b' File "/home/alex/Projects/Canonical/git/opendev.org/openstack/charm-ceph-proxy/.tox/py3/lib/python3.6/site-packages/mock/mock.py", line 1330, in patched'
    b' return func(*args, **keywargs)'
    b' File "/home/alex/Projects/Canonical/git/opendev.org/openstack/charm-ceph-proxy/unit_tests/test_ceph_hooks.py", line 132, in test_client_relation_joined'
    b" hooks.client_relation_joined('client:1')"
    b' File "/home/alex/Projects/Canonical/git/opendev.org/openstack/charm-ceph-proxy/hooks/ceph_hooks.py", line 201, in client_relation_joined'
    b" data = {'key': ceph.get_named_key(service_name),"
    b' File "/home/alex/Projects/Canonical/git/opendev.org/openstack/charm-ceph-proxy/hooks/ceph.py", line 398, in get_named_key'
    b' ceph_user(),'
    b' File "/home/alex/Projects/Canonical/git/opendev.org/openstack/charm-ceph-proxy/hooks/ceph.py", line 52, in ceph_user'
    b' if get_version() > 1:'
    b' File "/home/alex/Projects/Canonical/git/opendev.org/openstack/charm-ceph-proxy/hooks/ceph.py", line 94, in get_version'
    b' error_out(e)'
    b' File "/home/alex/Projects/Canonical/git/opendev.org/openstack/charm-ceph-proxy/hooks/ceph.py", line 115, in error_out'
    b' sys.exit(1)'
    b'SystemExit: 1'
    b''

Changed in charm-ceph-proxy:
status: New → Fix Released
milestone: none → 19.10
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.