Merge "Add connector object to create_export"
This commit is contained in:
commit
2b3f9f8ddb
@ -1299,7 +1299,7 @@ class CloudByteISCSIDriverTestCase(testtools.TestCase):
|
|||||||
mock_api_req.side_effect = self._side_effect_api_req
|
mock_api_req.side_effect = self._side_effect_api_req
|
||||||
|
|
||||||
# now run the test
|
# now run the test
|
||||||
model_update = self.driver.create_export({}, {})
|
model_update = self.driver.create_export({}, {}, {})
|
||||||
|
|
||||||
# assert the result
|
# assert the result
|
||||||
self.assertEqual('CHAP fakeauthgroupchapuser fakeauthgroupchapsecret',
|
self.assertEqual('CHAP fakeauthgroupchapuser fakeauthgroupchapsecret',
|
||||||
@ -1317,7 +1317,7 @@ class CloudByteISCSIDriverTestCase(testtools.TestCase):
|
|||||||
mock_api_req.side_effect = self._side_effect_api_req
|
mock_api_req.side_effect = self._side_effect_api_req
|
||||||
|
|
||||||
# now run the test
|
# now run the test
|
||||||
model_update = self.driver.create_export({}, {})
|
model_update = self.driver.create_export({}, {}, {})
|
||||||
|
|
||||||
# assert the result
|
# assert the result
|
||||||
self.assertEqual(None,
|
self.assertEqual(None,
|
||||||
@ -1354,7 +1354,7 @@ class CloudByteISCSIDriverTestCase(testtools.TestCase):
|
|||||||
mock_api_req.side_effect = self._side_effect_api_req
|
mock_api_req.side_effect = self._side_effect_api_req
|
||||||
|
|
||||||
# now run the test
|
# now run the test
|
||||||
model_update = self.driver.create_export({}, {})
|
model_update = self.driver.create_export({}, {}, {})
|
||||||
|
|
||||||
# assert the result
|
# assert the result
|
||||||
self.assertEqual(None,
|
self.assertEqual(None,
|
||||||
|
@ -1084,7 +1084,7 @@ class GPFSDriverTestCase(test.TestCase):
|
|||||||
self.assertEqual(None, self.driver.ensure_export('', ''))
|
self.assertEqual(None, self.driver.ensure_export('', ''))
|
||||||
|
|
||||||
def test_create_export(self):
|
def test_create_export(self):
|
||||||
self.assertEqual(None, self.driver.create_export('', ''))
|
self.assertEqual(None, self.driver.create_export('', '', {}))
|
||||||
|
|
||||||
def test_remove_export(self):
|
def test_remove_export(self):
|
||||||
self.assertEqual(None, self.driver.remove_export('', ''))
|
self.assertEqual(None, self.driver.remove_export('', ''))
|
||||||
|
@ -643,7 +643,7 @@ class NetAppDirectCmodeISCSIDriverTestCase(test.TestCase):
|
|||||||
'get_operational_network_interface_addresses',
|
'get_operational_network_interface_addresses',
|
||||||
mock.Mock(return_value=[]))
|
mock.Mock(return_value=[]))
|
||||||
self.driver.create_volume(self.volume)
|
self.driver.create_volume(self.volume)
|
||||||
updates = self.driver.create_export(None, self.volume)
|
updates = self.driver.create_export(None, self.volume, {})
|
||||||
self.assertTrue(updates['provider_location'])
|
self.assertTrue(updates['provider_location'])
|
||||||
self.volume['provider_location'] = updates['provider_location']
|
self.volume['provider_location'] = updates['provider_location']
|
||||||
|
|
||||||
@ -667,7 +667,7 @@ class NetAppDirectCmodeISCSIDriverTestCase(test.TestCase):
|
|||||||
'get_operational_network_interface_addresses',
|
'get_operational_network_interface_addresses',
|
||||||
mock.Mock(return_value=[]))
|
mock.Mock(return_value=[]))
|
||||||
self.driver.create_volume(self.volume)
|
self.driver.create_volume(self.volume)
|
||||||
updates = self.driver.create_export(None, self.volume)
|
updates = self.driver.create_export(None, self.volume, {})
|
||||||
self.assertTrue(updates['provider_location'])
|
self.assertTrue(updates['provider_location'])
|
||||||
self.volume['provider_location'] = updates['provider_location']
|
self.volume['provider_location'] = updates['provider_location']
|
||||||
connector_new = {'initiator': 'iqn.1993-08.org.debian:01:1001'}
|
connector_new = {'initiator': 'iqn.1993-08.org.debian:01:1001'}
|
||||||
|
@ -222,7 +222,7 @@ class StorPoolTestCase(test.TestCase):
|
|||||||
self.assertDictEqual({'client_id': 2, 'volume': '616'}, c['data'])
|
self.assertDictEqual({'client_id': 2, 'volume': '616'}, c['data'])
|
||||||
|
|
||||||
self.driver.terminate_connection(None, None)
|
self.driver.terminate_connection(None, None)
|
||||||
self.driver.create_export(None, None)
|
self.driver.create_export(None, None, {})
|
||||||
self.driver.remove_export(None, None)
|
self.driver.remove_export(None, None)
|
||||||
|
|
||||||
def test_stats(self):
|
def test_stats(self):
|
||||||
|
@ -2117,7 +2117,7 @@ class StorwizeSVCDriverTestCase(test.TestCase):
|
|||||||
self.driver.ensure_export(None, volume)
|
self.driver.ensure_export(None, volume)
|
||||||
|
|
||||||
# Do nothing
|
# Do nothing
|
||||||
self.driver.create_export(None, volume)
|
self.driver.create_export(None, volume, {})
|
||||||
self.driver.remove_export(None, volume)
|
self.driver.remove_export(None, volume)
|
||||||
|
|
||||||
# Make sure volume attributes are as they should be
|
# Make sure volume attributes are as they should be
|
||||||
|
@ -267,7 +267,7 @@ class VMwareEsxVmdkDriverTestCase(test.TestCase):
|
|||||||
|
|
||||||
def test_create_export(self):
|
def test_create_export(self):
|
||||||
"""Test create_export."""
|
"""Test create_export."""
|
||||||
self._driver.create_export(mox.IgnoreArg(), mox.IgnoreArg())
|
self._driver.create_export(mox.IgnoreArg(), mox.IgnoreArg(), {})
|
||||||
|
|
||||||
def test_ensure_export(self):
|
def test_ensure_export(self):
|
||||||
"""Test ensure_export."""
|
"""Test ensure_export."""
|
||||||
|
@ -179,13 +179,14 @@ class DateraVolumeTestCase(test.TestCase):
|
|||||||
}
|
}
|
||||||
|
|
||||||
self.assertEqual(expected, self.driver.create_export(ctxt,
|
self.assertEqual(expected, self.driver.create_export(ctxt,
|
||||||
self.volume))
|
self.volume,
|
||||||
|
{}))
|
||||||
|
|
||||||
def test_create_export_fails(self):
|
def test_create_export_fails(self):
|
||||||
self.mock_api.side_effect = exception.DateraAPIException
|
self.mock_api.side_effect = exception.DateraAPIException
|
||||||
ctxt = context.get_admin_context()
|
ctxt = context.get_admin_context()
|
||||||
self.assertRaises(exception.DateraAPIException,
|
self.assertRaises(exception.DateraAPIException,
|
||||||
self.driver.create_export, ctxt, self.volume)
|
self.driver.create_export, ctxt, self.volume, {})
|
||||||
|
|
||||||
def test_detach_volume_success(self):
|
def test_detach_volume_success(self):
|
||||||
self.mock_api.return_value = {}
|
self.mock_api.return_value = {}
|
||||||
|
@ -189,7 +189,7 @@ class TestWindowsDriver(test.TestCase):
|
|||||||
|
|
||||||
self.mox.ReplayAll()
|
self.mox.ReplayAll()
|
||||||
|
|
||||||
export_info = drv.create_export(None, volume)
|
export_info = drv.create_export(None, volume, {})
|
||||||
|
|
||||||
self.assertEqual(initiator_name, export_info['provider_location'])
|
self.assertEqual(initiator_name, export_info['provider_location'])
|
||||||
if chap_enabled:
|
if chap_enabled:
|
||||||
|
@ -682,7 +682,7 @@ class BaseVD(object):
|
|||||||
model_update = None
|
model_update = None
|
||||||
try:
|
try:
|
||||||
LOG.debug("Volume %s: creating export", volume['id'])
|
LOG.debug("Volume %s: creating export", volume['id'])
|
||||||
model_update = self.create_export(context, volume)
|
model_update = self.create_export(context, volume, properties)
|
||||||
if model_update:
|
if model_update:
|
||||||
volume = self.db.volume_update(context, volume['id'],
|
volume = self.db.volume_update(context, volume['id'],
|
||||||
model_update)
|
model_update)
|
||||||
@ -929,7 +929,7 @@ class BaseVD(object):
|
|||||||
return
|
return
|
||||||
|
|
||||||
@abc.abstractmethod
|
@abc.abstractmethod
|
||||||
def create_export(self, context, volume):
|
def create_export(self, context, volume, connector):
|
||||||
"""Exports the volume.
|
"""Exports the volume.
|
||||||
|
|
||||||
Can optionally return a Dictionary of changes
|
Can optionally return a Dictionary of changes
|
||||||
@ -1363,7 +1363,7 @@ class VolumeDriver(ConsistencyGroupVD, TransferVD, ManageableVD, ExtendVD,
|
|||||||
def ensure_export(self, context, volume):
|
def ensure_export(self, context, volume):
|
||||||
raise NotImplementedError()
|
raise NotImplementedError()
|
||||||
|
|
||||||
def create_export(self, context, volume):
|
def create_export(self, context, volume, connector):
|
||||||
raise NotImplementedError()
|
raise NotImplementedError()
|
||||||
|
|
||||||
def remove_export(self, context, volume):
|
def remove_export(self, context, volume):
|
||||||
@ -1811,7 +1811,7 @@ class FakeISCSIDriver(ISCSIDriver):
|
|||||||
"""Synchronously recreates an export for a volume."""
|
"""Synchronously recreates an export for a volume."""
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def create_export(self, context, volume):
|
def create_export(self, context, volume, connector):
|
||||||
"""Exports the volume.
|
"""Exports the volume.
|
||||||
|
|
||||||
Can optionally return a Dictionary of changes to the volume object to
|
Can optionally return a Dictionary of changes to the volume object to
|
||||||
|
@ -199,7 +199,7 @@ class BlockDeviceDriver(driver.BaseVD, driver.LocalVD, driver.CloneableVD,
|
|||||||
volume_path)
|
volume_path)
|
||||||
return model_update
|
return model_update
|
||||||
|
|
||||||
def create_export(self, context, volume):
|
def create_export(self, context, volume, connector):
|
||||||
volume_path = self.local_path(volume)
|
volume_path = self.local_path(volume)
|
||||||
export_info = self.target_driver.create_export(context,
|
export_info = self.target_driver.create_export(context,
|
||||||
volume,
|
volume,
|
||||||
|
@ -435,7 +435,7 @@ class BlockbridgeISCSIDriver(driver.ISCSIDriver):
|
|||||||
user_id=snapshot['user_id'],
|
user_id=snapshot['user_id'],
|
||||||
project_id=snapshot['project_id'])
|
project_id=snapshot['project_id'])
|
||||||
|
|
||||||
def create_export(self, _ctx, volume):
|
def create_export(self, _ctx, volume, connector):
|
||||||
"""Do nothing: target created during instance attachment."""
|
"""Do nothing: target created during instance attachment."""
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
@ -1012,7 +1012,7 @@ class CloudByteISCSIDriver(san.SanISCSIDriver):
|
|||||||
# Request the CloudByte api to update the volume
|
# Request the CloudByte api to update the volume
|
||||||
self._api_request_for_cloudbyte('updateFileSystem', params)
|
self._api_request_for_cloudbyte('updateFileSystem', params)
|
||||||
|
|
||||||
def create_export(self, context, volume):
|
def create_export(self, context, volume, connector):
|
||||||
"""Setup the iscsi export info."""
|
"""Setup the iscsi export info."""
|
||||||
|
|
||||||
return self._export()
|
return self._export()
|
||||||
|
@ -194,7 +194,7 @@ class DateraDriver(san.SanISCSIDriver):
|
|||||||
def ensure_export(self, context, volume):
|
def ensure_export(self, context, volume):
|
||||||
return self._do_export(context, volume)
|
return self._do_export(context, volume)
|
||||||
|
|
||||||
def create_export(self, context, volume):
|
def create_export(self, context, volume, connector):
|
||||||
return self._do_export(context, volume)
|
return self._do_export(context, volume)
|
||||||
|
|
||||||
def detach_volume(self, context, volume, attachment=None):
|
def detach_volume(self, context, volume, attachment=None):
|
||||||
|
@ -289,7 +289,7 @@ class DellCommonDriver(driver.ConsistencyGroupVD, driver.ManageableVD,
|
|||||||
raise exception.VolumeBackendAPIException(
|
raise exception.VolumeBackendAPIException(
|
||||||
_('Failed to delete snapshot %s') % snapshot_id)
|
_('Failed to delete snapshot %s') % snapshot_id)
|
||||||
|
|
||||||
def create_export(self, context, volume):
|
def create_export(self, context, volume, connector):
|
||||||
"""Create an export of a volume.
|
"""Create an export of a volume.
|
||||||
|
|
||||||
The volume exists on creation and will be visible on
|
The volume exists on creation and will be visible on
|
||||||
|
@ -141,7 +141,7 @@ class DotHillFCDriver(cinder.volume.driver.FibreChannelDriver):
|
|||||||
self.__class__.__name__)
|
self.__class__.__name__)
|
||||||
return stats
|
return stats
|
||||||
|
|
||||||
def create_export(self, context, volume):
|
def create_export(self, context, volume, connector):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def ensure_export(self, context, volume):
|
def ensure_export(self, context, volume):
|
||||||
|
@ -153,7 +153,7 @@ class DotHillISCSIDriver(cinder.volume.driver.ISCSIDriver):
|
|||||||
self.__class__.__name__)
|
self.__class__.__name__)
|
||||||
return stats
|
return stats
|
||||||
|
|
||||||
def create_export(self, context, volume):
|
def create_export(self, context, volume, connector):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def ensure_export(self, context, volume):
|
def ensure_export(self, context, volume):
|
||||||
|
@ -507,7 +507,7 @@ class DrbdManageDriver(driver.VolumeDriver):
|
|||||||
volume,
|
volume,
|
||||||
volume_path)
|
volume_path)
|
||||||
|
|
||||||
def create_export(self, context, volume):
|
def create_export(self, context, volume, connector):
|
||||||
volume_path = self.local_path(volume)
|
volume_path = self.local_path(volume)
|
||||||
export_info = self.target_driver.create_export(
|
export_info = self.target_driver.create_export(
|
||||||
context,
|
context,
|
||||||
|
@ -110,7 +110,7 @@ class EMCCLIFCDriver(driver.FibreChannelDriver):
|
|||||||
"""Driver entry point to get the export info for an existing volume."""
|
"""Driver entry point to get the export info for an existing volume."""
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def create_export(self, context, volume):
|
def create_export(self, context, volume, connector):
|
||||||
"""Driver entry point to get the export info for a new volume."""
|
"""Driver entry point to get the export info for a new volume."""
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
@ -107,7 +107,7 @@ class EMCCLIISCSIDriver(driver.ISCSIDriver):
|
|||||||
"""Driver entry point to get the export info for an existing volume."""
|
"""Driver entry point to get the export info for an existing volume."""
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def create_export(self, context, volume):
|
def create_export(self, context, volume, connector):
|
||||||
"""Driver entry point to get the export info for a new volume."""
|
"""Driver entry point to get the export info for a new volume."""
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
@ -117,7 +117,7 @@ class EMCVMAXFCDriver(driver.FibreChannelDriver):
|
|||||||
"""Driver entry point to get the export info for an existing volume."""
|
"""Driver entry point to get the export info for an existing volume."""
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def create_export(self, context, volume):
|
def create_export(self, context, volume, connector):
|
||||||
"""Driver entry point to get the export info for a new volume."""
|
"""Driver entry point to get the export info for a new volume."""
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
@ -124,7 +124,7 @@ class EMCVMAXISCSIDriver(driver.ISCSIDriver):
|
|||||||
"""Driver entry point to get the export info for an existing volume."""
|
"""Driver entry point to get the export info for an existing volume."""
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def create_export(self, context, volume):
|
def create_export(self, context, volume, connector):
|
||||||
"""Driver entry point to get the export info for a new volume."""
|
"""Driver entry point to get the export info for a new volume."""
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
@ -1141,7 +1141,7 @@ class ScaleIODriver(driver.VolumeDriver):
|
|||||||
"""Driver entry point to get the export info for an existing volume."""
|
"""Driver entry point to get the export info for an existing volume."""
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def create_export(self, context, volume):
|
def create_export(self, context, volume, connector):
|
||||||
"""Driver entry point to get the export info for a new volume."""
|
"""Driver entry point to get the export info for a new volume."""
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
@ -510,7 +510,7 @@ class DellEQLSanISCSIDriver(san.SanISCSIDriver):
|
|||||||
'to volume "%s".'),
|
'to volume "%s".'),
|
||||||
volume['name'])
|
volume['name'])
|
||||||
|
|
||||||
def create_export(self, context, volume):
|
def create_export(self, context, volume, connector):
|
||||||
"""Create an export of a volume.
|
"""Create an export of a volume.
|
||||||
|
|
||||||
Driver has nothing to do here for the volume has been exported
|
Driver has nothing to do here for the volume has been exported
|
||||||
|
@ -268,7 +268,7 @@ class GlusterfsDriver(remotefs_drv.RemoteFSSnapDriver, driver.CloneableVD,
|
|||||||
|
|
||||||
self._ensure_share_mounted(volume['provider_location'])
|
self._ensure_share_mounted(volume['provider_location'])
|
||||||
|
|
||||||
def create_export(self, ctx, volume):
|
def create_export(self, ctx, volume, connector):
|
||||||
"""Exports the volume."""
|
"""Exports the volume."""
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
@ -585,7 +585,7 @@ class HGSTDriver(driver.VolumeDriver):
|
|||||||
"""Query the provider_id to figure out the proper devnode."""
|
"""Query the provider_id to figure out the proper devnode."""
|
||||||
return "/dev/" + self._get_space_name(volume)
|
return "/dev/" + self._get_space_name(volume)
|
||||||
|
|
||||||
def create_export(self, context, volume):
|
def create_export(self, context, volume, connector):
|
||||||
# Not needed for spaces
|
# Not needed for spaces
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
@ -473,7 +473,7 @@ class HBSDFCDriver(cinder.volume.driver.FibreChannelDriver):
|
|||||||
def discard_zero_page(self, volume):
|
def discard_zero_page(self, volume):
|
||||||
self.common.command.discard_zero_page(self.common.get_ldev(volume))
|
self.common.command.discard_zero_page(self.common.get_ldev(volume))
|
||||||
|
|
||||||
def create_export(self, context, volume):
|
def create_export(self, context, volume, connector):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def ensure_export(self, context, volume):
|
def ensure_export(self, context, volume):
|
||||||
|
@ -384,7 +384,7 @@ class HBSDISCSIDriver(cinder.volume.driver.ISCSIDriver):
|
|||||||
self.common.volume_info[ldev]['in_use']:
|
self.common.volume_info[ldev]['in_use']:
|
||||||
self._terminate_connection(ldev, connector, hostgroups)
|
self._terminate_connection(ldev, connector, hostgroups)
|
||||||
|
|
||||||
def create_export(self, context, volume):
|
def create_export(self, context, volume, connector):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def ensure_export(self, context, volume):
|
def ensure_export(self, context, volume):
|
||||||
|
@ -424,7 +424,7 @@ class HDSISCSIDriver(driver.ISCSIDriver):
|
|||||||
def ensure_export(self, context, volume):
|
def ensure_export(self, context, volume):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def create_export(self, context, volume):
|
def create_export(self, context, volume, connector):
|
||||||
"""Create an export. Moved to initialize_connection.
|
"""Create an export. Moved to initialize_connection.
|
||||||
|
|
||||||
:param context:
|
:param context:
|
||||||
|
@ -566,7 +566,7 @@ class HuaweiBaseDriver(driver.VolumeDriver):
|
|||||||
def migrate_volume(self, context, volume, host):
|
def migrate_volume(self, context, volume, host):
|
||||||
return (False, None)
|
return (False, None)
|
||||||
|
|
||||||
def create_export(self, context, volume):
|
def create_export(self, context, volume, connector):
|
||||||
"""Export a volume."""
|
"""Export a volume."""
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
@ -742,7 +742,7 @@ class GPFSDriver(driver.ConsistencyGroupVD, driver.ExtendVD,
|
|||||||
"""Synchronously recreates an export for a logical volume."""
|
"""Synchronously recreates an export for a logical volume."""
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def create_export(self, context, volume):
|
def create_export(self, context, volume, connector):
|
||||||
"""Exports the volume."""
|
"""Exports the volume."""
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
@ -315,7 +315,7 @@ class StorwizeSVCDriver(san.SanDriver,
|
|||||||
LOG.error(_LE('ensure_export: Volume %s not found on storage.'),
|
LOG.error(_LE('ensure_export: Volume %s not found on storage.'),
|
||||||
volume['name'])
|
volume['name'])
|
||||||
|
|
||||||
def create_export(self, ctxt, volume):
|
def create_export(self, ctxt, volume, connector):
|
||||||
model_update = None
|
model_update = None
|
||||||
return model_update
|
return model_update
|
||||||
|
|
||||||
|
@ -110,7 +110,7 @@ class XIVDS8KDriver(san.SanDriver,
|
|||||||
|
|
||||||
return self.xiv_ds8k_proxy.ensure_export(context, volume)
|
return self.xiv_ds8k_proxy.ensure_export(context, volume)
|
||||||
|
|
||||||
def create_export(self, context, volume):
|
def create_export(self, context, volume, connector):
|
||||||
"""Create an export."""
|
"""Create an export."""
|
||||||
|
|
||||||
return self.xiv_ds8k_proxy.create_export(context, volume)
|
return self.xiv_ds8k_proxy.create_export(context, volume)
|
||||||
|
@ -123,7 +123,7 @@ class InfortrendCLIFCDriver(driver.FibreChannelDriver):
|
|||||||
"""Synchronously recreates an export for a volume."""
|
"""Synchronously recreates an export for a volume."""
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def create_export(self, context, volume):
|
def create_export(self, context, volume, connector):
|
||||||
"""Exports the volume.
|
"""Exports the volume.
|
||||||
|
|
||||||
Can optionally return a Dictionary of changes
|
Can optionally return a Dictionary of changes
|
||||||
|
@ -121,7 +121,7 @@ class InfortrendCLIISCSIDriver(driver.ISCSIDriver):
|
|||||||
"""Synchronously recreates an export for a volume."""
|
"""Synchronously recreates an export for a volume."""
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def create_export(self, context, volume):
|
def create_export(self, context, volume, connector):
|
||||||
"""Exports the volume.
|
"""Exports the volume.
|
||||||
|
|
||||||
Can optionally return a Dictionary of changes
|
Can optionally return a Dictionary of changes
|
||||||
|
@ -654,7 +654,7 @@ class LVMVolumeDriver(driver.VolumeDriver):
|
|||||||
self.target_driver.ensure_export(context, volume, volume_path)
|
self.target_driver.ensure_export(context, volume, volume_path)
|
||||||
return model_update
|
return model_update
|
||||||
|
|
||||||
def create_export(self, context, volume, vg=None):
|
def create_export(self, context, volume, connector, vg=None):
|
||||||
if vg is None:
|
if vg is None:
|
||||||
vg = self.configuration.volume_group
|
vg = self.configuration.volume_group
|
||||||
|
|
||||||
|
@ -68,7 +68,7 @@ class NetApp7modeFibreChannelDriver(driver.FibreChannelDriver):
|
|||||||
def ensure_export(self, context, volume):
|
def ensure_export(self, context, volume):
|
||||||
return self.library.ensure_export(context, volume)
|
return self.library.ensure_export(context, volume)
|
||||||
|
|
||||||
def create_export(self, context, volume):
|
def create_export(self, context, volume, connector):
|
||||||
return self.library.create_export(context, volume)
|
return self.library.create_export(context, volume)
|
||||||
|
|
||||||
def remove_export(self, context, volume):
|
def remove_export(self, context, volume):
|
||||||
|
@ -68,7 +68,7 @@ class NetAppCmodeFibreChannelDriver(driver.FibreChannelDriver):
|
|||||||
def ensure_export(self, context, volume):
|
def ensure_export(self, context, volume):
|
||||||
return self.library.ensure_export(context, volume)
|
return self.library.ensure_export(context, volume)
|
||||||
|
|
||||||
def create_export(self, context, volume):
|
def create_export(self, context, volume, connector):
|
||||||
return self.library.create_export(context, volume)
|
return self.library.create_export(context, volume)
|
||||||
|
|
||||||
def remove_export(self, context, volume):
|
def remove_export(self, context, volume):
|
||||||
|
@ -67,7 +67,7 @@ class NetApp7modeISCSIDriver(driver.ISCSIDriver):
|
|||||||
def ensure_export(self, context, volume):
|
def ensure_export(self, context, volume):
|
||||||
return self.library.ensure_export(context, volume)
|
return self.library.ensure_export(context, volume)
|
||||||
|
|
||||||
def create_export(self, context, volume):
|
def create_export(self, context, volume, connector):
|
||||||
return self.library.create_export(context, volume)
|
return self.library.create_export(context, volume)
|
||||||
|
|
||||||
def remove_export(self, context, volume):
|
def remove_export(self, context, volume):
|
||||||
|
@ -67,7 +67,7 @@ class NetAppCmodeISCSIDriver(driver.ISCSIDriver):
|
|||||||
def ensure_export(self, context, volume):
|
def ensure_export(self, context, volume):
|
||||||
return self.library.ensure_export(context, volume)
|
return self.library.ensure_export(context, volume)
|
||||||
|
|
||||||
def create_export(self, context, volume):
|
def create_export(self, context, volume, connector):
|
||||||
return self.library.create_export(context, volume)
|
return self.library.create_export(context, volume)
|
||||||
|
|
||||||
def remove_export(self, context, volume):
|
def remove_export(self, context, volume):
|
||||||
|
@ -75,7 +75,7 @@ class NetAppEseriesFibreChannelDriver(driver.BaseVD,
|
|||||||
def ensure_export(self, context, volume):
|
def ensure_export(self, context, volume):
|
||||||
return self.library.ensure_export(context, volume)
|
return self.library.ensure_export(context, volume)
|
||||||
|
|
||||||
def create_export(self, context, volume):
|
def create_export(self, context, volume, connector):
|
||||||
return self.library.create_export(context, volume)
|
return self.library.create_export(context, volume)
|
||||||
|
|
||||||
def remove_export(self, context, volume):
|
def remove_export(self, context, volume):
|
||||||
|
@ -77,7 +77,7 @@ class NetAppEseriesISCSIDriver(driver.BaseVD,
|
|||||||
def ensure_export(self, context, volume):
|
def ensure_export(self, context, volume):
|
||||||
return self.library.ensure_export(context, volume)
|
return self.library.ensure_export(context, volume)
|
||||||
|
|
||||||
def create_export(self, context, volume):
|
def create_export(self, context, volume, connector):
|
||||||
return self.library.create_export(context, volume)
|
return self.library.create_export(context, volume)
|
||||||
|
|
||||||
def remove_export(self, context, volume):
|
def remove_export(self, context, volume):
|
||||||
|
@ -227,7 +227,7 @@ class NimbleISCSIDriver(san.SanISCSIDriver):
|
|||||||
self._clone_volume_from_snapshot(volume, snapshot)
|
self._clone_volume_from_snapshot(volume, snapshot)
|
||||||
return self._get_model_info(volume['name'])
|
return self._get_model_info(volume['name'])
|
||||||
|
|
||||||
def create_export(self, context, volume):
|
def create_export(self, context, volume, connector):
|
||||||
"""Driver entry point to get the export info for a new volume."""
|
"""Driver entry point to get the export info for a new volume."""
|
||||||
return self._get_model_info(volume['name'])
|
return self._get_model_info(volume['name'])
|
||||||
|
|
||||||
|
@ -857,7 +857,7 @@ class DPLCOMMONDriver(driver.ConsistencyGroupVD, driver.ExtendVD,
|
|||||||
raise exception.VolumeBackendAPIException(data=msg)
|
raise exception.VolumeBackendAPIException(data=msg)
|
||||||
return snapshotID
|
return snapshotID
|
||||||
|
|
||||||
def create_export(self, context, volume):
|
def create_export(self, context, volume, connector):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def ensure_export(self, context, volume):
|
def ensure_export(self, context, volume):
|
||||||
|
@ -205,7 +205,7 @@ class PureBaseVolumeDriver(san.SanDriver):
|
|||||||
def ensure_export(self, context, volume):
|
def ensure_export(self, context, volume):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def create_export(self, context, volume):
|
def create_export(self, context, volume, connector):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def _get_host(self, connector):
|
def _get_host(self, connector):
|
||||||
|
@ -790,7 +790,7 @@ class RBDDriver(driver.RetypeVD, driver.TransferVD, driver.ExtendVD,
|
|||||||
"""Synchronously recreates an export for a logical volume."""
|
"""Synchronously recreates an export for a logical volume."""
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def create_export(self, context, volume):
|
def create_export(self, context, volume, connector):
|
||||||
"""Exports the volume."""
|
"""Exports the volume."""
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
@ -294,7 +294,7 @@ class RemoteFSDriver(driver.LocalVD, driver.TransferVD, driver.BaseVD):
|
|||||||
"""Synchronously recreates an export for a logical volume."""
|
"""Synchronously recreates an export for a logical volume."""
|
||||||
self._ensure_share_mounted(volume['provider_location'])
|
self._ensure_share_mounted(volume['provider_location'])
|
||||||
|
|
||||||
def create_export(self, ctx, volume):
|
def create_export(self, ctx, volume, connector):
|
||||||
"""Exports the volume.
|
"""Exports the volume.
|
||||||
|
|
||||||
Can optionally return a dictionary of changes
|
Can optionally return a dictionary of changes
|
||||||
|
@ -411,7 +411,7 @@ class HP3PARFCDriver(cinder.volume.driver.FibreChannelDriver):
|
|||||||
host = common._get_3par_host(host['name'])
|
host = common._get_3par_host(host['name'])
|
||||||
return host
|
return host
|
||||||
|
|
||||||
def create_export(self, context, volume):
|
def create_export(self, context, volume, connector):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def ensure_export(self, context, volume):
|
def ensure_export(self, context, volume):
|
||||||
|
@ -554,7 +554,7 @@ class HP3PARISCSIDriver(cinder.volume.driver.ISCSIDriver):
|
|||||||
|
|
||||||
return model_update
|
return model_update
|
||||||
|
|
||||||
def create_export(self, context, volume):
|
def create_export(self, context, volume, connector):
|
||||||
common = self._login()
|
common = self._login()
|
||||||
try:
|
try:
|
||||||
return self._do_export(common, volume)
|
return self._do_export(common, volume)
|
||||||
|
@ -450,7 +450,7 @@ class HPLeftHandCLIQProxy(san.SanISCSIDriver):
|
|||||||
def create_cloned_volume(self, volume, src_vref):
|
def create_cloned_volume(self, volume, src_vref):
|
||||||
raise NotImplementedError()
|
raise NotImplementedError()
|
||||||
|
|
||||||
def create_export(self, context, volume):
|
def create_export(self, context, volume, connector):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def ensure_export(self, context, volume):
|
def ensure_export(self, context, volume):
|
||||||
|
@ -148,8 +148,8 @@ class HPLeftHandISCSIDriver(driver.TransferVD,
|
|||||||
def create_cloned_volume(self, volume, src_vref):
|
def create_cloned_volume(self, volume, src_vref):
|
||||||
return self.proxy.create_cloned_volume(volume, src_vref)
|
return self.proxy.create_cloned_volume(volume, src_vref)
|
||||||
|
|
||||||
def create_export(self, context, volume):
|
def create_export(self, context, volume, connector):
|
||||||
return self.proxy.create_export(context, volume)
|
return self.proxy.create_export(context, volume, connector)
|
||||||
|
|
||||||
def ensure_export(self, context, volume):
|
def ensure_export(self, context, volume):
|
||||||
return self.proxy.ensure_export(context, volume)
|
return self.proxy.ensure_export(context, volume)
|
||||||
|
@ -508,7 +508,7 @@ class HPLeftHandRESTProxy(driver.ISCSIDriver):
|
|||||||
optional)
|
optional)
|
||||||
return server_info
|
return server_info
|
||||||
|
|
||||||
def create_export(self, context, volume):
|
def create_export(self, context, volume, connector):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def ensure_export(self, context, volume):
|
def ensure_export(self, context, volume):
|
||||||
|
@ -134,7 +134,7 @@ class HPXPFCDriver(driver.FibreChannelDriver):
|
|||||||
def ensure_export(self, context, volume):
|
def ensure_export(self, context, volume):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def create_export(self, context, volume):
|
def create_export(self, context, volume, connector):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def remove_export(self, context, volume):
|
def remove_export(self, context, volume):
|
||||||
|
@ -153,7 +153,7 @@ class SanDriver(driver.BaseVD):
|
|||||||
"""Synchronously recreates an export for a logical volume."""
|
"""Synchronously recreates an export for a logical volume."""
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def create_export(self, context, volume):
|
def create_export(self, context, volume, connector):
|
||||||
"""Exports the volume."""
|
"""Exports the volume."""
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
@ -194,7 +194,7 @@ class ScalityDriver(driver.VolumeDriver):
|
|||||||
"""Synchronously recreates an export for a logical volume."""
|
"""Synchronously recreates an export for a logical volume."""
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def create_export(self, context, volume):
|
def create_export(self, context, volume, connector):
|
||||||
"""Exports the volume.
|
"""Exports the volume.
|
||||||
|
|
||||||
Can optionally return a Dictionary of changes to the volume
|
Can optionally return a Dictionary of changes to the volume
|
||||||
|
@ -218,7 +218,7 @@ class SheepdogDriver(driver.VolumeDriver):
|
|||||||
"""Safely and synchronously recreate an export for a logical volume."""
|
"""Safely and synchronously recreate an export for a logical volume."""
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def create_export(self, context, volume):
|
def create_export(self, context, volume, connector):
|
||||||
"""Export a volume."""
|
"""Export a volume."""
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
@ -1229,7 +1229,7 @@ class SolidFireDriver(san.SanISCSIDriver):
|
|||||||
def ensure_export(self, context, volume):
|
def ensure_export(self, context, volume):
|
||||||
return self.target_driver.ensure_export(context, volume, None)
|
return self.target_driver.ensure_export(context, volume, None)
|
||||||
|
|
||||||
def create_export(self, context, volume):
|
def create_export(self, context, volume, connector):
|
||||||
return self.target_driver.create_export(
|
return self.target_driver.create_export(
|
||||||
context,
|
context,
|
||||||
volume,
|
volume,
|
||||||
|
@ -850,7 +850,7 @@ class SRBISCSIDriver(SRBDriver, driver.ISCSIDriver):
|
|||||||
if model_update:
|
if model_update:
|
||||||
self.db.volume_update(context, volume['id'], model_update)
|
self.db.volume_update(context, volume['id'], model_update)
|
||||||
|
|
||||||
def create_export(self, context, volume):
|
def create_export(self, context, volume, connector):
|
||||||
"""Creates an export for a logical volume."""
|
"""Creates an export for a logical volume."""
|
||||||
self._attach_file(volume)
|
self._attach_file(volume)
|
||||||
vg = self._get_lvm_vg(volume)
|
vg = self._get_lvm_vg(volume)
|
||||||
|
@ -183,7 +183,7 @@ class StorPoolDriver(driver.TransferVD, driver.ExtendVD, driver.CloneableVD,
|
|||||||
"%(msg)s"),
|
"%(msg)s"),
|
||||||
{'name': snapname, 'msg': e})
|
{'name': snapname, 'msg': e})
|
||||||
|
|
||||||
def create_export(self, context, volume):
|
def create_export(self, context, volume, connector):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def remove_export(self, context, volume):
|
def remove_export(self, context, volume):
|
||||||
|
@ -125,7 +125,7 @@ class V6000FCDriver(driver.FibreChannelDriver):
|
|||||||
"""Synchronously checks and re-exports volumes at cinder start time."""
|
"""Synchronously checks and re-exports volumes at cinder start time."""
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def create_export(self, context, volume):
|
def create_export(self, context, volume, connector):
|
||||||
"""Exports the volume."""
|
"""Exports the volume."""
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
@ -150,7 +150,7 @@ class V6000ISCSIDriver(driver.ISCSIDriver):
|
|||||||
"""Synchronously checks and re-exports volumes at cinder start time."""
|
"""Synchronously checks and re-exports volumes at cinder start time."""
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def create_export(self, context, volume):
|
def create_export(self, context, volume, connector):
|
||||||
"""Exports the volume."""
|
"""Exports the volume."""
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
@ -122,7 +122,7 @@ class V7000FCPDriver(driver.FibreChannelDriver):
|
|||||||
"""Synchronously checks and re-exports volumes at cinder start time."""
|
"""Synchronously checks and re-exports volumes at cinder start time."""
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def create_export(self, context, volume):
|
def create_export(self, context, volume, connector):
|
||||||
"""Exports the volume."""
|
"""Exports the volume."""
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
@ -587,7 +587,7 @@ class VMwareEsxVmdkDriver(driver.VolumeDriver):
|
|||||||
def terminate_connection(self, volume, connector, force=False, **kwargs):
|
def terminate_connection(self, volume, connector, force=False, **kwargs):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def create_export(self, context, volume):
|
def create_export(self, context, volume, connector):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def ensure_export(self, context, volume):
|
def ensure_export(self, context, volume):
|
||||||
|
@ -133,7 +133,7 @@ class WindowsDriver(driver.ISCSIDriver):
|
|||||||
# iSCSI targets exported by WinTarget persist after host reboot.
|
# iSCSI targets exported by WinTarget persist after host reboot.
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def create_export(self, context, volume):
|
def create_export(self, context, volume, connector):
|
||||||
"""Driver entry point to get the export info for a new volume."""
|
"""Driver entry point to get the export info for a new volume."""
|
||||||
# Since the iSCSI targets are not reused, being deleted when the
|
# Since the iSCSI targets are not reused, being deleted when the
|
||||||
# volume is detached, we should clean up existing targets before
|
# volume is detached, we should clean up existing targets before
|
||||||
|
@ -1486,7 +1486,7 @@ class XIOISEISCSIDriver(driver.ISCSIDriver):
|
|||||||
def delete_snapshot(self, snapshot):
|
def delete_snapshot(self, snapshot):
|
||||||
return self.driver.delete_snapshot(snapshot)
|
return self.driver.delete_snapshot(snapshot)
|
||||||
|
|
||||||
def create_export(self, context, volume):
|
def create_export(self, context, volume, connector):
|
||||||
return self.driver.create_export(context, volume)
|
return self.driver.create_export(context, volume)
|
||||||
|
|
||||||
def ensure_export(self, context, volume):
|
def ensure_export(self, context, volume):
|
||||||
@ -1595,7 +1595,7 @@ class XIOISEFCDriver(driver.FibreChannelDriver):
|
|||||||
def delete_snapshot(self, snapshot):
|
def delete_snapshot(self, snapshot):
|
||||||
return self.driver.delete_snapshot(snapshot)
|
return self.driver.delete_snapshot(snapshot)
|
||||||
|
|
||||||
def create_export(self, context, volume):
|
def create_export(self, context, volume, connector):
|
||||||
return self.driver.create_export(context, volume)
|
return self.driver.create_export(context, volume)
|
||||||
|
|
||||||
def ensure_export(self, context, volume):
|
def ensure_export(self, context, volume):
|
||||||
|
@ -366,7 +366,7 @@ class ZFSSAISCSIDriver(driver.ISCSIDriver):
|
|||||||
self._update_volume_status()
|
self._update_volume_status()
|
||||||
return self._stats
|
return self._stats
|
||||||
|
|
||||||
def create_export(self, context, volume):
|
def create_export(self, context, volume, connector):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def remove_export(self, context, volume):
|
def remove_export(self, context, volume):
|
||||||
|
@ -1085,7 +1085,7 @@ class VolumeManager(manager.SchedulerDependentManager):
|
|||||||
|
|
||||||
try:
|
try:
|
||||||
model_update = self.driver.create_export(context.elevated(),
|
model_update = self.driver.create_export(context.elevated(),
|
||||||
volume)
|
volume, connector)
|
||||||
except exception.CinderException:
|
except exception.CinderException:
|
||||||
err_msg = (_("Create export for volume failed."))
|
err_msg = (_("Create export for volume failed."))
|
||||||
LOG.exception(err_msg, resource=volume)
|
LOG.exception(err_msg, resource=volume)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user