class DumbVolume(object):
+ # TODO(eharney): replace this with an autospecced mock class
fields = {}
def __setitem__(self, key, value):
[mock.call('mount.nfs',
check_exit_code=False,
run_as_root=False)])
+
+ def test_update_migrated_volume_is_there(self):
+ """Ensure that driver.update_migrated_volume() is there."""
+
+ drv = nfs.NfsDriver(configuration=self.configuration)
+
+ v1 = DumbVolume()
+ v2 = DumbVolume()
+
+ self.assertRaises(NotImplementedError,
+ drv.update_migrated_volume,
+ self.context,
+ v1,
+ v2,
+ mock.sentinel)
"""Fail if connector doesn't contain all the data needed by driver."""
pass
+ def update_migrated_volume(self, ctxt, volume, new_volume,
+ original_volume_status):
+ """Return model update for migrated volume.
+
+ Each driver implementing this method needs to be responsible for the
+ values of _name_id and provider_location. If None is returned or either
+ key is not set, it means the volume table does not need to change the
+ value(s) for the key(s).
+ The return format is {"_name_id": value, "provider_location": value}.
+
+ :param volume: The original volume that was migrated to this backend
+ :param new_volume: The migration volume object that was created on
+ this backend as part of the migration process
+ :param original_volume_status: The status of the original volume
+ :return model_update to update DB with any needed changes
+ """
+ msg = _("The method update_migrated_volume is not implemented.")
+ raise NotImplementedError(msg)
+
@staticmethod
def validate_connector_has_setting(connector, setting):
pass
"""
return None
- def update_migrated_volume(self, ctxt, volume, new_volume,
- original_volume_status):
- """Return model update for migrated volume.
-
- Each driver implementing this method needs to be responsible for the
- values of _name_id and provider_location. If None is returned or either
- key is not set, it means the volume table does not need to change the
- value(s) for the key(s).
- The return format is {"_name_id": value, "provider_location": value}.
-
- :param volume: The original volume that was migrated to this backend
- :param new_volume: The migration volume object that was created on
- this backend as part of the migration process
- :param original_volume_status: The status of the original volume
- :return model_update to update DB with any needed changes
- """
- msg = _("The method update_migrated_volume is not implemented.")
- raise NotImplementedError(msg)
-
def migrate_volume(self, context, volume, host):
return (False, None)