Merge "Add support for rbd_exclusive_cinder_pool"
This commit is contained in:
commit
08592dd8a6
|
@ -50,19 +50,15 @@ class CephSubordinateContext(OSContextGenerator):
|
||||||
volume_driver = 'cinder.volume.drivers.rbd.RBDDriver'
|
volume_driver = 'cinder.volume.drivers.rbd.RBDDriver'
|
||||||
else:
|
else:
|
||||||
volume_driver = 'cinder.volume.driver.RBDDriver'
|
volume_driver = 'cinder.volume.driver.RBDDriver'
|
||||||
return {
|
|
||||||
"cinder": {
|
section = {service: [('volume_backend_name', service),
|
||||||
"/etc/cinder/cinder.conf": {
|
('volume_driver', volume_driver),
|
||||||
"sections": {
|
('rbd_pool', service),
|
||||||
service: [
|
('rbd_user', service),
|
||||||
('volume_backend_name', service),
|
('rbd_secret_uuid', leader_get('secret-uuid')),
|
||||||
('volume_driver', volume_driver),
|
('rbd_ceph_conf', ceph_config_file())]}
|
||||||
('rbd_pool', service),
|
|
||||||
('rbd_user', service),
|
if CompareOpenStackReleases(os_codename) >= "queens":
|
||||||
('rbd_secret_uuid', leader_get('secret-uuid')),
|
section[service].append(('rbd_exclusive_cinder_pool', True))
|
||||||
('rbd_ceph_conf', ceph_config_file()),
|
|
||||||
]
|
return {'cinder': {'/etc/cinder/cinder.conf': {'sections': section}}}
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
|
@ -358,6 +358,10 @@ class CinderCephBasicDeployment(OpenStackAmuletDeployment):
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if self._get_openstack_release() >= self.xenial_queens:
|
||||||
|
section = sub_dict['cinder']["/etc/cinder/cinder.conf"]["sections"]
|
||||||
|
section["cinder-ceph"].append(('rbd_exclusive_cinder_pool', True))
|
||||||
|
|
||||||
expected = {
|
expected = {
|
||||||
'subordinate_configuration': json.dumps(sub_dict),
|
'subordinate_configuration': json.dumps(sub_dict),
|
||||||
'private-address': u.valid_ip,
|
'private-address': u.valid_ip,
|
||||||
|
|
|
@ -84,3 +84,28 @@ class TestCinderContext(CharmTestCase):
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}})
|
}})
|
||||||
|
|
||||||
|
def test_ceph_related_queens(self):
|
||||||
|
self.is_relation_made.return_value = True
|
||||||
|
self.get_os_codename_package.return_value = "queens"
|
||||||
|
service = 'mycinder'
|
||||||
|
self.service_name.return_value = service
|
||||||
|
self.assertEqual(
|
||||||
|
contexts.CephSubordinateContext()(),
|
||||||
|
{"cinder": {
|
||||||
|
"/etc/cinder/cinder.conf": {
|
||||||
|
"sections": {
|
||||||
|
service: [
|
||||||
|
('volume_backend_name', service),
|
||||||
|
('volume_driver',
|
||||||
|
'cinder.volume.drivers.rbd.RBDDriver'),
|
||||||
|
('rbd_pool', service),
|
||||||
|
('rbd_user', service),
|
||||||
|
('rbd_secret_uuid', 'libvirt-uuid'),
|
||||||
|
('rbd_ceph_conf',
|
||||||
|
'/var/lib/charm/mycinder/ceph.conf'),
|
||||||
|
('rbd_exclusive_cinder_pool', True)
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}})
|
||||||
|
|
Loading…
Reference in New Issue