os_release() uses default release in install hook

Bug #1788266 reported by Corey Bryant
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Neutron Open vSwitch Charm
Fix Released
Undecided
Corey Bryant

Bug Description

os_release determines the OpenStack release in this order:
1) based on an installed package
2) based on openstack-origin
3) default

def os_release(package, base='essex', reset_cache=False):
    ...
    _os_rel = (
        get_os_codename_package(package, fatal=False) or
        get_os_codename_install_source(config('openstack-origin')) or
        base)
    return _os_rel

Since neutron-openvswitch is a subordinate charm, it doesn't have an openstack-origin config option. Therefore, when called via determine_packages() in the install hook:

    cmp_release = CompareOpenStackReleases(
        os_release('neutron-common', base='icehouse'))

the order results in:
1) None (because 'neutron-common' isn't yet installed)
2) None (because neutron-openvswitch doesn't have openstack-origin)
3) icehouse (because it's the default/base)

This causes the charm to attempt to install the old neutron-plugin-openvswitch-agent package, which was removed in rocky. See determine_packages():

    if cmp_release >= 'mitaka' and 'neutron-plugin-openvswitch-agent' in pkgs:
        pkgs.remove('neutron-plugin-openvswitch-agent')
        pkgs.append('neutron-openvswitch-agent')

description: updated
description: updated
Changed in charm-neutron-openvswitch:
assignee: nobody → Corey Bryant (corey.bryant)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on charm-neutron-openvswitch (master)

Change abandoned by Corey Bryant (<email address hidden>) on branch: master
Review: https://review.openstack.org/594516
Reason: There's already a fix in progress for this at: https://review.openstack.org/#/c/592343/

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

Reviewed: https://review.openstack.org/592343
Committed: https://git.openstack.org/cgit/openstack/charm-neutron-openvswitch/commit/?id=56d60366c775b309c6d989d4ac0399a3ef10e17e
Submitter: Zuul
Branch: master

commit 56d60366c775b309c6d989d4ac0399a3ef10e17e
Author: James Page <email address hidden>
Date: Thu Aug 16 11:36:46 2018 +0100

    Deal with lack of neutron-plugin-openvswitch-agent

    The neutron-plugin-openvswitch-agent package has been dropped @ Rocky.

    Pre-install neutron-common and ensure any previously cached os_release
    value is reset when evaluating which OpenStack release is being installed,
    ensuring that the correct package for the neutron-openvswitch-agent is
    used.

    Closes-Bug: #1788266
    Change-Id: I1224aa7f5e7caa6a8aaf2ab3043fac9c62735749

Changed in charm-neutron-openvswitch:
status: In Progress → Fix Committed
David Ames (thedac)
Changed in charm-neutron-openvswitch:
milestone: none → 18.08
James Page (james-page)
Changed in charm-neutron-openvswitch:
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.