Fix alphanumeric comparisons for openstack and ubuntu releases

- sync charmhelpers with fix-alpha helpers
- fix up code where the alpha comparisons are done

Change-Id: Ibd6e8489582af08710976ad4c8c0d81856e62117
Depends-On: Ic808064b0009c04e9aba18d6e909851ab7fec3d6
Related-Bug: #1659575
This commit is contained in:
Alex Kavanagh 2017-03-29 18:53:07 +01:00 committed by Ryan Beisner
parent 55208193c3
commit da7566cff9
1 changed files with 6 additions and 3 deletions

View File

@ -26,7 +26,9 @@ from charmhelpers.core.host import (
cmp_pkgrevno,
lsb_release,
service_stop,
service_restart)
service_restart,
CompareHostReleases,
)
from charms.reactive import is_state
from charmhelpers.core.hookenv import (
log,
@ -189,7 +191,8 @@ def get_network_addrs(config_opt):
def assert_charm_supports_ipv6():
"""Check whether we are able to support charms ipv6."""
if lsb_release()['DISTRIB_CODENAME'].lower() < "trusty":
_release = lsb_release()['DISTRIB_CODENAME'].lower()
if CompareHostReleases(_release) < "trusty":
raise Exception("IPv6 is not supported in the charms for Ubuntu "
"versions less than Trusty 14.04")
@ -794,7 +797,7 @@ def upgrade_key_caps(key, caps):
@cached
def systemd():
return (lsb_release()['DISTRIB_CODENAME'] >= 'vivid')
return CompareHostReleases(lsb_release()['DISTRIB_CODENAME']) >= 'vivid'
def bootstrap_monitor_cluster(secret):