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: I904f5faf2bd8fc28204d5e26c94877708cb98d7e Related-Bug: #1659575
This commit is contained in:
parent
957ea0ad69
commit
2305eabe27
|
@ -19,7 +19,8 @@ from charmhelpers.core.hookenv import (
|
|||
cached,
|
||||
config,
|
||||
network_get_primary_address,
|
||||
log, DEBUG,
|
||||
log,
|
||||
DEBUG,
|
||||
status_set,
|
||||
)
|
||||
from charmhelpers.core import unitdata
|
||||
|
@ -29,7 +30,8 @@ from charmhelpers.fetch import (
|
|||
)
|
||||
|
||||
from charmhelpers.core.host import (
|
||||
lsb_release
|
||||
lsb_release,
|
||||
CompareHostReleases,
|
||||
)
|
||||
|
||||
from charmhelpers.contrib.network.ip import (
|
||||
|
@ -163,7 +165,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")
|
||||
|
||||
|
|
|
@ -38,7 +38,9 @@ from charmhelpers.core.host import (
|
|||
owner,
|
||||
service_restart,
|
||||
service_start,
|
||||
service_stop)
|
||||
service_stop,
|
||||
CompareHostReleases,
|
||||
)
|
||||
from charmhelpers.core.hookenv import (
|
||||
cached,
|
||||
config,
|
||||
|
@ -46,21 +48,28 @@ from charmhelpers.core.hookenv import (
|
|||
status_set,
|
||||
DEBUG,
|
||||
ERROR,
|
||||
WARNING)
|
||||
WARNING,
|
||||
)
|
||||
from charmhelpers.fetch import (
|
||||
apt_cache,
|
||||
add_source, apt_install, apt_update)
|
||||
add_source,
|
||||
apt_install,
|
||||
apt_update,
|
||||
)
|
||||
from charmhelpers.contrib.storage.linux.ceph import (
|
||||
monitor_key_set,
|
||||
monitor_key_exists,
|
||||
monitor_key_get,
|
||||
get_mon_map)
|
||||
get_mon_map,
|
||||
)
|
||||
from charmhelpers.contrib.storage.linux.utils import (
|
||||
is_block_device,
|
||||
zap_disk,
|
||||
is_device_mounted)
|
||||
is_device_mounted,
|
||||
)
|
||||
from charmhelpers.contrib.openstack.utils import (
|
||||
get_os_codename_install_source)
|
||||
get_os_codename_install_source,
|
||||
)
|
||||
|
||||
from ceph.ceph_helpers import check_output
|
||||
|
||||
|
@ -1180,7 +1189,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):
|
||||
|
|
Loading…
Reference in New Issue