Install hook fails when principal charm is py3

Bug #1734295 reported by Chris MacNaughton
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
OpenStack Ceilometer Agent Charm
Fix Released
High
Liam Young

Bug Description

When the principal charm is py2, apt_pkg gets installed and is available for ceilometer-agent; however, when the principal is py3, cielometer-agent fails its install hook

2017-11-24 07:40:53 DEBUG install Traceback (most recent call last):
2017-11-24 07:40:53 DEBUG install File "/var/lib/juju/agents/unit-ceilometer-agent-2/charm/hooks/install", line 52, in <module>
2017-11-24 07:40:53 DEBUG install CONFIGS = register_configs()
2017-11-24 07:40:53 DEBUG install File "/var/lib/juju/agents/unit-ceilometer-agent-2/charm/hooks/ceilometer_utils.py", line 95, in register_configs
2017-11-24 07:40:53 DEBUG install release = get_os_codename_package('ceilometer-common', fatal=False) \
2017-11-24 07:40:53 DEBUG install File "/var/lib/juju/agents/unit-ceilometer-agent-2/charm/hooks/charmhelpers/contrib/openstack/utils.py", line 429, in get_os_codename_package
2017-11-24 07:40:53 DEBUG install import apt_pkg as apt
2017-11-24 07:40:53 DEBUG install ImportError: No module named apt_pkg

Revision history for this message
James Page (james-page) wrote :

commit d73568eb13e1f696a447ef72d2cbcd3e3bbb90ec
Author: Liam Young <email address hidden>
Date: Fri Nov 24 09:21:44 2017 +0000

    Install python-apt before hooks run

    Previously this charm had relied on python-apt being installed by
    the principle. As charms migrate to py3 this is no longer a safe
    assumption and actually never was. This change ensures that
    python-apt is installed before immediatly. This follows the same
    pattern as other charms by adding an install and install.real
    files.

    Change-Id: I9fe2a031df736b867d4f277448a4d8649fa8de64

Changed in charm-ceilometer-agent:
status: New → Fix Committed
importance: Undecided → High
milestone: none → 17.11
assignee: nobody → Liam Young (gnuoy)
James Page (james-page)
Changed in charm-ceilometer-agent:
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.