Comment 0 for bug 1659575

Revision history for this message
Ryan Beisner (1chb1n) wrote :

Presuming that after 'z' will come 'a' - with regard to distro codename, several charms are about to have unintended behavior due to the use of alpha comparison logic. The numeric version comparison should be used instead.

I've not done a full audit of all OpenStack Charms but that needs to be done as soon as possible, and associated with this bug.

Here are a some examples which need to be fixed:

https://github.com/openstack/charm-nova-compute/search?utf8=%E2%9C%93&q=distro_codename

distro_codename = lsb_release()['DISTRIB_CODENAME'].lower()
         release = os_release('nova-common')

         # NOTE(jamespage): deal with switch to systemd
         if distro_codename < "wily":

distro_codename = lsb_release()['DISTRIB_CODENAME'].lower()
     if distro_codename >= 'yakkety':
         return LIBVIRTD_DAEMON

.

Here is an example of the safe way to do it:

https://github.com/openstack/charm-nova-cloud-controller/search?utf8=%E2%9C%93&q=DISTRIB_RELEASE&type=Code

bin_dir = os.path.join(git_pip_venv_dir(projects_yaml), 'bin')
     # Use systemd init units/scripts from ubuntu wily onward
     if lsb_release()['DISTRIB_RELEASE'] >= '15.10':