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: Iaaacbd84204911442b955a4d5cd2a6e1ede99553 Related-Bug: #1659575
This commit is contained in:
parent
ff9136ae5a
commit
286dadfed4
@ -987,18 +987,20 @@ def ensure_ceph_storage(service, pool, rbd_img, sizemb, mount_point,
|
||||
service_start(svc)
|
||||
|
||||
|
||||
def ensure_ceph_keyring(service, user=None, group=None, relation='ceph'):
|
||||
def ensure_ceph_keyring(service, user=None, group=None,
|
||||
relation='ceph', key=None):
|
||||
"""Ensures a ceph keyring is created for a named service and optionally
|
||||
ensures user and group ownership.
|
||||
|
||||
Returns False if no ceph key is available in relation state.
|
||||
@returns boolean: Flag to indicate whether a key was successfully written
|
||||
to disk based on either relation data or a supplied key
|
||||
"""
|
||||
key = None
|
||||
for rid in relation_ids(relation):
|
||||
for unit in related_units(rid):
|
||||
key = relation_get('key', rid=rid, unit=unit)
|
||||
if key:
|
||||
break
|
||||
if not key:
|
||||
for rid in relation_ids(relation):
|
||||
for unit in related_units(rid):
|
||||
key = relation_get('key', rid=rid, unit=unit)
|
||||
if key:
|
||||
break
|
||||
|
||||
if not key:
|
||||
return False
|
||||
|
@ -22,7 +22,10 @@ from charmhelpers.contrib.openstack.context import (
|
||||
OSContextGenerator,
|
||||
)
|
||||
|
||||
from charmhelpers.contrib.openstack.utils import get_os_codename_package
|
||||
from charmhelpers.contrib.openstack.utils import (
|
||||
get_os_codename_package,
|
||||
CompareOpenStackReleases,
|
||||
)
|
||||
|
||||
|
||||
class CephSubordinateContext(OSContextGenerator):
|
||||
@ -37,7 +40,7 @@ class CephSubordinateContext(OSContextGenerator):
|
||||
return {}
|
||||
service = service_name()
|
||||
os_codename = get_os_codename_package('cinder-common')
|
||||
if os_codename >= "icehouse":
|
||||
if CompareOpenStackReleases(os_codename) >= "icehouse":
|
||||
volume_driver = 'cinder.volume.drivers.rbd.RBDDriver'
|
||||
else:
|
||||
volume_driver = 'cinder.volume.driver.RBDDriver'
|
||||
|
Loading…
x
Reference in New Issue
Block a user