Browse Source

Merge "smbfs: pick up remotefs method signature change"

changes/85/744285/1
Zuul 3 days ago
committed by Gerrit Code Review
parent
commit
d616afa033
2 changed files with 20 additions and 1 deletions
  1. +11
    -0
      cinder/tests/unit/windows/test_smbfs.py
  2. +9
    -1
      cinder/volume/drivers/windows/smbfs.py

+ 11
- 0
cinder/tests/unit/windows/test_smbfs.py View File

@@ -847,6 +847,17 @@ class WindowsSmbFsTestCase(test.TestCase):
self.volume.size * units.Gi,
is_file_max_size=False)

def test_copy_encrypted_volume_from_snapshot(self):
# We expect an exception to be raised if an encryption
# key is provided since we don't support encryted volumes
# for the time being.
self.assertRaises(exception.NotSupportedOperation,
self._smbfs_driver._copy_volume_from_snapshot,
self.snapshot, self.volume,
self.volume.size,
mock.sentinel.src_key,
mock.sentinel.dest_key)

def test_rebase_img(self):
drv = self._smbfs_driver
drv._rebase_img(


+ 9
- 1
cinder/volume/drivers/windows/smbfs.py View File

@@ -606,9 +606,17 @@ class WindowsSmbfsDriver(remotefs_drv.RevertToSnapshotMixin,
volume.size * units.Gi,
is_file_max_size=False)

def _copy_volume_from_snapshot(self, snapshot, volume, volume_size):
def _copy_volume_from_snapshot(self, snapshot, volume, volume_size,
src_encryption_key_id=None,
new_encryption_key_id=None):
"""Copy data from snapshot to destination volume."""

if new_encryption_key_id:
msg = _("Encryption key %s was requested. Volume "
"encryption is not currently supported.")
raise exception.NotSupportedOperation(
message=msg % new_encryption_key_id)

LOG.debug("snapshot: %(snap)s, volume: %(vol)s, "
"volume_size: %(size)s",
{'snap': snapshot.id,


Loading…
Cancel
Save