default_select_release does not take release_pkg into account
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
charms.openstack |
Fix Released
|
High
|
Liam Young |
Bug Description
default_
The problem with default release handlers is that they are not aware of <concrete-
A custom release selector could avoid that but I would rather avoid this in every subordinate charm:
@register_
def select_release():
"""Determine the release based on the keystone package version.
Note that this function caches the release after the first install so
that it doesn't need to keep going and getting it from the package
information.
"""
import pdb
pdb.set_trace()
release_version = unitdata.
if release_version is None:
return release_version
class KeystoneLDAPCha
abstract_class = False
...
# Package to derive application version from
release_pkg = 'keystone'
Changed in charms.openstack: | |
assignee: | nobody → Liam Young (gnuoy) |
importance: | Undecided → High |
status: | New → Confirmed |
This is quite interesting to solve. Obviously, the selecting a release is concretely "selecting a class implementation" so we don't know which class is the one we want!
The 'release_pkg' class property appeared after the 'selecting a release' functionality was implemented, which is why it doesn't know/use it.
One thing we could do is to look at all of the concrete classes that have registered themselves (by virtue of inheriting from BaseOpenStackCharm or friends). We could work through these in release order, see if 'release_pkg' exists, determine if the package is actually available, as it might have 'gone' in a later release, and then determine the release.
We could do this optionally if the 'python- keystonemiddlew are' package doesn't exist.
It would probably need to be abstracted in some way because we have to support both packages and snaps.
Thoughts?