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:

committed by
Ryan Beisner

parent
55208193c3
commit
da7566cff9
@@ -26,7 +26,9 @@ from charmhelpers.core.host import (
|
|||||||
cmp_pkgrevno,
|
cmp_pkgrevno,
|
||||||
lsb_release,
|
lsb_release,
|
||||||
service_stop,
|
service_stop,
|
||||||
service_restart)
|
service_restart,
|
||||||
|
CompareHostReleases,
|
||||||
|
)
|
||||||
from charms.reactive import is_state
|
from charms.reactive import is_state
|
||||||
from charmhelpers.core.hookenv import (
|
from charmhelpers.core.hookenv import (
|
||||||
log,
|
log,
|
||||||
@@ -189,7 +191,8 @@ def get_network_addrs(config_opt):
|
|||||||
|
|
||||||
def assert_charm_supports_ipv6():
|
def assert_charm_supports_ipv6():
|
||||||
"""Check whether we are able to support charms 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 "
|
raise Exception("IPv6 is not supported in the charms for Ubuntu "
|
||||||
"versions less than Trusty 14.04")
|
"versions less than Trusty 14.04")
|
||||||
|
|
||||||
@@ -794,7 +797,7 @@ def upgrade_key_caps(key, caps):
|
|||||||
|
|
||||||
@cached
|
@cached
|
||||||
def systemd():
|
def systemd():
|
||||||
return (lsb_release()['DISTRIB_CODENAME'] >= 'vivid')
|
return CompareHostReleases(lsb_release()['DISTRIB_CODENAME']) >= 'vivid'
|
||||||
|
|
||||||
|
|
||||||
def bootstrap_monitor_cluster(secret):
|
def bootstrap_monitor_cluster(secret):
|
||||||
|
Reference in New Issue
Block a user