Merge "RBD: prevent creation of encrypted volumes"
This commit is contained in:
commit
9fcb3bf1ad
@ -207,6 +207,14 @@ class RBDTestCase(test.TestCase):
|
||||
client.__enter__.assert_called_once_with()
|
||||
client.__exit__.assert_called_once_with(None, None, None)
|
||||
|
||||
@common_mocks
|
||||
def test_create_encrypted_volume(self):
|
||||
self.volume_a.encryption_key_id = \
|
||||
'00000000-0000-0000-0000-000000000000'
|
||||
self.assertRaises(exception.VolumeDriverException,
|
||||
self.driver.create_volume,
|
||||
self.volume_a)
|
||||
|
||||
@common_mocks
|
||||
def test_manage_existing_get_size(self):
|
||||
with mock.patch.object(self.driver.rbd.Image(), 'size') as \
|
||||
|
@ -458,6 +458,11 @@ class RBDDriver(driver.TransferVD, driver.ExtendVD,
|
||||
|
||||
def create_volume(self, volume):
|
||||
"""Creates a logical volume."""
|
||||
|
||||
if volume.encryption_key_id:
|
||||
message = _("Encryption is not yet supported.")
|
||||
raise exception.VolumeDriverException(message=message)
|
||||
|
||||
size = int(volume.size) * units.Gi
|
||||
|
||||
LOG.debug("creating volume '%s'", volume.name)
|
||||
|
Loading…
Reference in New Issue
Block a user