Use os_release instead of get_os_codename_install_source
os_release provides the same functionality in addition to supporting openstack-origin-git, when deployed from source. Change-Id: I5c01dd76596732d5f7f95dda0fcdcfc4aa1e850b
This commit is contained in:
parent
e3362bcc6c
commit
ca8fe0b81f
@ -29,7 +29,7 @@ from charmhelpers.contrib.openstack.context import (
|
||||
)
|
||||
|
||||
from charmhelpers.contrib.openstack.utils import (
|
||||
get_os_codename_install_source
|
||||
os_release,
|
||||
)
|
||||
|
||||
from charmhelpers.contrib.hahelpers.cluster import (
|
||||
@ -58,8 +58,7 @@ class CephContext(OSContextGenerator):
|
||||
if not relation_ids('ceph'):
|
||||
return {}
|
||||
service = service_name()
|
||||
if get_os_codename_install_source(config('openstack-origin')) \
|
||||
>= "icehouse":
|
||||
if os_release('cinder-common') >= "icehouse":
|
||||
volume_driver = 'cinder.volume.drivers.rbd.RBDDriver'
|
||||
else:
|
||||
volume_driver = 'cinder.volume.driver.RBDDriver'
|
||||
|
@ -28,7 +28,7 @@ TO_PATCH = [
|
||||
'service_name',
|
||||
'determine_apache_port',
|
||||
'determine_api_port',
|
||||
'get_os_codename_install_source',
|
||||
'os_release',
|
||||
'related_units',
|
||||
'relation_get'
|
||||
]
|
||||
@ -61,7 +61,7 @@ class TestCinderContext(CharmTestCase):
|
||||
|
||||
def test_ceph_related(self):
|
||||
self.relation_ids.return_value = ['ceph:0']
|
||||
self.get_os_codename_install_source.return_value = 'havana'
|
||||
self.os_release.return_value = 'havana'
|
||||
service = 'mycinder'
|
||||
self.service_name.return_value = service
|
||||
self.assertEquals(
|
||||
@ -73,7 +73,7 @@ class TestCinderContext(CharmTestCase):
|
||||
|
||||
def test_ceph_related_icehouse(self):
|
||||
self.relation_ids.return_value = ['ceph:0']
|
||||
self.get_os_codename_install_source.return_value = 'icehouse'
|
||||
self.os_release.return_value = 'icehouse'
|
||||
service = 'mycinder'
|
||||
self.service_name.return_value = service
|
||||
self.assertEquals(
|
||||
|
Loading…
x
Reference in New Issue
Block a user