From ecab4005f08781581d3d9239e7145fca2a259b35 Mon Sep 17 00:00:00 2001 From: "Walter A. Boring IV" Date: Thu, 16 Jul 2015 14:48:37 -0700 Subject: [PATCH] Add connector object to create_export This patch adds the connector object as a parameter to all driver create_export calls. This will enable drivers to actually use create_export method for doing what they are now doing inside of initialize_connection. Change-Id: Ia13897a3704080fc5da71e6c8445f308d474f64a Implements: blueprint add-create-export-connector --- cinder/tests/unit/test_cloudbyte.py | 6 +++--- cinder/tests/unit/test_gpfs.py | 2 +- cinder/tests/unit/test_netapp.py | 4 ++-- cinder/tests/unit/test_storpool.py | 2 +- cinder/tests/unit/test_storwize_svc.py | 2 +- cinder/tests/unit/test_vmware_vmdk.py | 2 +- cinder/tests/unit/volume/drivers/test_datera.py | 5 +++-- cinder/tests/unit/windows/test_windows.py | 2 +- cinder/volume/driver.py | 8 ++++---- cinder/volume/drivers/block_device.py | 2 +- cinder/volume/drivers/blockbridge.py | 2 +- cinder/volume/drivers/cloudbyte/cloudbyte.py | 2 +- cinder/volume/drivers/datera.py | 2 +- cinder/volume/drivers/dell/dell_storagecenter_common.py | 2 +- cinder/volume/drivers/dothill/dothill_fc.py | 2 +- cinder/volume/drivers/dothill/dothill_iscsi.py | 2 +- cinder/volume/drivers/drbdmanagedrv.py | 2 +- cinder/volume/drivers/emc/emc_cli_fc.py | 2 +- cinder/volume/drivers/emc/emc_cli_iscsi.py | 2 +- cinder/volume/drivers/emc/emc_vmax_fc.py | 2 +- cinder/volume/drivers/emc/emc_vmax_iscsi.py | 2 +- cinder/volume/drivers/emc/scaleio.py | 2 +- cinder/volume/drivers/eqlx.py | 2 +- cinder/volume/drivers/glusterfs.py | 2 +- cinder/volume/drivers/hgst.py | 2 +- cinder/volume/drivers/hitachi/hbsd_fc.py | 2 +- cinder/volume/drivers/hitachi/hbsd_iscsi.py | 2 +- cinder/volume/drivers/hitachi/hnas_iscsi.py | 2 +- cinder/volume/drivers/huawei/huawei_driver.py | 2 +- cinder/volume/drivers/ibm/gpfs.py | 2 +- cinder/volume/drivers/ibm/storwize_svc/__init__.py | 2 +- cinder/volume/drivers/ibm/xiv_ds8k.py | 2 +- cinder/volume/drivers/infortrend/infortrend_fc_cli.py | 2 +- cinder/volume/drivers/infortrend/infortrend_iscsi_cli.py | 2 +- cinder/volume/drivers/lvm.py | 2 +- cinder/volume/drivers/netapp/dataontap/fc_7mode.py | 2 +- cinder/volume/drivers/netapp/dataontap/fc_cmode.py | 2 +- cinder/volume/drivers/netapp/dataontap/iscsi_7mode.py | 2 +- cinder/volume/drivers/netapp/dataontap/iscsi_cmode.py | 2 +- cinder/volume/drivers/netapp/eseries/fc_driver.py | 2 +- cinder/volume/drivers/netapp/eseries/iscsi_driver.py | 2 +- cinder/volume/drivers/nimble.py | 2 +- cinder/volume/drivers/prophetstor/dplcommon.py | 2 +- cinder/volume/drivers/pure.py | 2 +- cinder/volume/drivers/rbd.py | 2 +- cinder/volume/drivers/remotefs.py | 2 +- cinder/volume/drivers/san/hp/hp_3par_fc.py | 2 +- cinder/volume/drivers/san/hp/hp_3par_iscsi.py | 2 +- cinder/volume/drivers/san/hp/hp_lefthand_cliq_proxy.py | 2 +- cinder/volume/drivers/san/hp/hp_lefthand_iscsi.py | 4 ++-- cinder/volume/drivers/san/hp/hp_lefthand_rest_proxy.py | 2 +- cinder/volume/drivers/san/hp/hp_xp_fc.py | 2 +- cinder/volume/drivers/san/san.py | 2 +- cinder/volume/drivers/scality.py | 2 +- cinder/volume/drivers/sheepdog.py | 2 +- cinder/volume/drivers/solidfire.py | 2 +- cinder/volume/drivers/srb.py | 2 +- cinder/volume/drivers/storpool.py | 2 +- cinder/volume/drivers/violin/v6000_fcp.py | 2 +- cinder/volume/drivers/violin/v6000_iscsi.py | 2 +- cinder/volume/drivers/violin/v7000_fcp.py | 2 +- cinder/volume/drivers/vmware/vmdk.py | 2 +- cinder/volume/drivers/windows/windows.py | 2 +- cinder/volume/drivers/xio.py | 4 ++-- cinder/volume/drivers/zfssa/zfssaiscsi.py | 2 +- cinder/volume/manager.py | 2 +- 66 files changed, 76 insertions(+), 75 deletions(-) diff --git a/cinder/tests/unit/test_cloudbyte.py b/cinder/tests/unit/test_cloudbyte.py index 0cbe523da..662908dc7 100644 --- a/cinder/tests/unit/test_cloudbyte.py +++ b/cinder/tests/unit/test_cloudbyte.py @@ -1299,7 +1299,7 @@ class CloudByteISCSIDriverTestCase(testtools.TestCase): mock_api_req.side_effect = self._side_effect_api_req # now run the test - model_update = self.driver.create_export({}, {}) + model_update = self.driver.create_export({}, {}, {}) # assert the result self.assertEqual('CHAP fakeauthgroupchapuser fakeauthgroupchapsecret', @@ -1317,7 +1317,7 @@ class CloudByteISCSIDriverTestCase(testtools.TestCase): mock_api_req.side_effect = self._side_effect_api_req # now run the test - model_update = self.driver.create_export({}, {}) + model_update = self.driver.create_export({}, {}, {}) # assert the result self.assertEqual(None, @@ -1354,7 +1354,7 @@ class CloudByteISCSIDriverTestCase(testtools.TestCase): mock_api_req.side_effect = self._side_effect_api_req # now run the test - model_update = self.driver.create_export({}, {}) + model_update = self.driver.create_export({}, {}, {}) # assert the result self.assertEqual(None, diff --git a/cinder/tests/unit/test_gpfs.py b/cinder/tests/unit/test_gpfs.py index 8e3a0edd4..480d14281 100644 --- a/cinder/tests/unit/test_gpfs.py +++ b/cinder/tests/unit/test_gpfs.py @@ -1084,7 +1084,7 @@ class GPFSDriverTestCase(test.TestCase): self.assertEqual(None, self.driver.ensure_export('', '')) def test_create_export(self): - self.assertEqual(None, self.driver.create_export('', '')) + self.assertEqual(None, self.driver.create_export('', '', {})) def test_remove_export(self): self.assertEqual(None, self.driver.remove_export('', '')) diff --git a/cinder/tests/unit/test_netapp.py b/cinder/tests/unit/test_netapp.py index 32aad89b6..104be3bc6 100644 --- a/cinder/tests/unit/test_netapp.py +++ b/cinder/tests/unit/test_netapp.py @@ -643,7 +643,7 @@ class NetAppDirectCmodeISCSIDriverTestCase(test.TestCase): 'get_operational_network_interface_addresses', mock.Mock(return_value=[])) 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.volume['provider_location'] = updates['provider_location'] @@ -667,7 +667,7 @@ class NetAppDirectCmodeISCSIDriverTestCase(test.TestCase): 'get_operational_network_interface_addresses', mock.Mock(return_value=[])) 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.volume['provider_location'] = updates['provider_location'] connector_new = {'initiator': 'iqn.1993-08.org.debian:01:1001'} diff --git a/cinder/tests/unit/test_storpool.py b/cinder/tests/unit/test_storpool.py index 780e06271..71f8f36fb 100644 --- a/cinder/tests/unit/test_storpool.py +++ b/cinder/tests/unit/test_storpool.py @@ -222,7 +222,7 @@ class StorPoolTestCase(test.TestCase): self.assertDictEqual({'client_id': 2, 'volume': '616'}, c['data']) self.driver.terminate_connection(None, None) - self.driver.create_export(None, None) + self.driver.create_export(None, None, {}) self.driver.remove_export(None, None) def test_stats(self): diff --git a/cinder/tests/unit/test_storwize_svc.py b/cinder/tests/unit/test_storwize_svc.py index e063c9f45..d8a2a4b08 100644 --- a/cinder/tests/unit/test_storwize_svc.py +++ b/cinder/tests/unit/test_storwize_svc.py @@ -2117,7 +2117,7 @@ class StorwizeSVCDriverTestCase(test.TestCase): self.driver.ensure_export(None, volume) # Do nothing - self.driver.create_export(None, volume) + self.driver.create_export(None, volume, {}) self.driver.remove_export(None, volume) # Make sure volume attributes are as they should be diff --git a/cinder/tests/unit/test_vmware_vmdk.py b/cinder/tests/unit/test_vmware_vmdk.py index d28c5eb8b..efda339ee 100644 --- a/cinder/tests/unit/test_vmware_vmdk.py +++ b/cinder/tests/unit/test_vmware_vmdk.py @@ -267,7 +267,7 @@ class VMwareEsxVmdkDriverTestCase(test.TestCase): def test_create_export(self): """Test create_export.""" - self._driver.create_export(mox.IgnoreArg(), mox.IgnoreArg()) + self._driver.create_export(mox.IgnoreArg(), mox.IgnoreArg(), {}) def test_ensure_export(self): """Test ensure_export.""" diff --git a/cinder/tests/unit/volume/drivers/test_datera.py b/cinder/tests/unit/volume/drivers/test_datera.py index 42cf9b3b6..8c4296014 100644 --- a/cinder/tests/unit/volume/drivers/test_datera.py +++ b/cinder/tests/unit/volume/drivers/test_datera.py @@ -179,13 +179,14 @@ class DateraVolumeTestCase(test.TestCase): } self.assertEqual(expected, self.driver.create_export(ctxt, - self.volume)) + self.volume, + {})) def test_create_export_fails(self): self.mock_api.side_effect = exception.DateraAPIException ctxt = context.get_admin_context() self.assertRaises(exception.DateraAPIException, - self.driver.create_export, ctxt, self.volume) + self.driver.create_export, ctxt, self.volume, {}) def test_detach_volume_success(self): self.mock_api.return_value = {} diff --git a/cinder/tests/unit/windows/test_windows.py b/cinder/tests/unit/windows/test_windows.py index e26cfcb36..8e73d1630 100644 --- a/cinder/tests/unit/windows/test_windows.py +++ b/cinder/tests/unit/windows/test_windows.py @@ -189,7 +189,7 @@ class TestWindowsDriver(test.TestCase): 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']) if chap_enabled: diff --git a/cinder/volume/driver.py b/cinder/volume/driver.py index 9275d3fd0..66f8d6361 100644 --- a/cinder/volume/driver.py +++ b/cinder/volume/driver.py @@ -682,7 +682,7 @@ class BaseVD(object): model_update = None try: 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: volume = self.db.volume_update(context, volume['id'], model_update) @@ -929,7 +929,7 @@ class BaseVD(object): return @abc.abstractmethod - def create_export(self, context, volume): + def create_export(self, context, volume, connector): """Exports the volume. Can optionally return a Dictionary of changes @@ -1363,7 +1363,7 @@ class VolumeDriver(ConsistencyGroupVD, TransferVD, ManageableVD, ExtendVD, def ensure_export(self, context, volume): raise NotImplementedError() - def create_export(self, context, volume): + def create_export(self, context, volume, connector): raise NotImplementedError() def remove_export(self, context, volume): @@ -1811,7 +1811,7 @@ class FakeISCSIDriver(ISCSIDriver): """Synchronously recreates an export for a volume.""" pass - def create_export(self, context, volume): + def create_export(self, context, volume, connector): """Exports the volume. Can optionally return a Dictionary of changes to the volume object to diff --git a/cinder/volume/drivers/block_device.py b/cinder/volume/drivers/block_device.py index bed0c5867..cfe778a2e 100644 --- a/cinder/volume/drivers/block_device.py +++ b/cinder/volume/drivers/block_device.py @@ -199,7 +199,7 @@ class BlockDeviceDriver(driver.BaseVD, driver.LocalVD, driver.CloneableVD, volume_path) return model_update - def create_export(self, context, volume): + def create_export(self, context, volume, connector): volume_path = self.local_path(volume) export_info = self.target_driver.create_export(context, volume, diff --git a/cinder/volume/drivers/blockbridge.py b/cinder/volume/drivers/blockbridge.py index 7661841d1..b0530d0bc 100644 --- a/cinder/volume/drivers/blockbridge.py +++ b/cinder/volume/drivers/blockbridge.py @@ -435,7 +435,7 @@ class BlockbridgeISCSIDriver(driver.ISCSIDriver): user_id=snapshot['user_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.""" pass diff --git a/cinder/volume/drivers/cloudbyte/cloudbyte.py b/cinder/volume/drivers/cloudbyte/cloudbyte.py index e49470219..c6c8e6bc6 100644 --- a/cinder/volume/drivers/cloudbyte/cloudbyte.py +++ b/cinder/volume/drivers/cloudbyte/cloudbyte.py @@ -1012,7 +1012,7 @@ class CloudByteISCSIDriver(san.SanISCSIDriver): # Request the CloudByte api to update the volume 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.""" return self._export() diff --git a/cinder/volume/drivers/datera.py b/cinder/volume/drivers/datera.py index 19523acca..fa6ff7ae9 100644 --- a/cinder/volume/drivers/datera.py +++ b/cinder/volume/drivers/datera.py @@ -194,7 +194,7 @@ class DateraDriver(san.SanISCSIDriver): def ensure_export(self, 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) def detach_volume(self, context, volume, attachment=None): diff --git a/cinder/volume/drivers/dell/dell_storagecenter_common.py b/cinder/volume/drivers/dell/dell_storagecenter_common.py index 4de4e123e..c8741cab5 100644 --- a/cinder/volume/drivers/dell/dell_storagecenter_common.py +++ b/cinder/volume/drivers/dell/dell_storagecenter_common.py @@ -289,7 +289,7 @@ class DellCommonDriver(driver.ConsistencyGroupVD, driver.ManageableVD, raise exception.VolumeBackendAPIException( _('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. The volume exists on creation and will be visible on diff --git a/cinder/volume/drivers/dothill/dothill_fc.py b/cinder/volume/drivers/dothill/dothill_fc.py index 840c43542..0c47ded05 100644 --- a/cinder/volume/drivers/dothill/dothill_fc.py +++ b/cinder/volume/drivers/dothill/dothill_fc.py @@ -141,7 +141,7 @@ class DotHillFCDriver(cinder.volume.driver.FibreChannelDriver): self.__class__.__name__) return stats - def create_export(self, context, volume): + def create_export(self, context, volume, connector): pass def ensure_export(self, context, volume): diff --git a/cinder/volume/drivers/dothill/dothill_iscsi.py b/cinder/volume/drivers/dothill/dothill_iscsi.py index ced984340..de9357446 100644 --- a/cinder/volume/drivers/dothill/dothill_iscsi.py +++ b/cinder/volume/drivers/dothill/dothill_iscsi.py @@ -153,7 +153,7 @@ class DotHillISCSIDriver(cinder.volume.driver.ISCSIDriver): self.__class__.__name__) return stats - def create_export(self, context, volume): + def create_export(self, context, volume, connector): pass def ensure_export(self, context, volume): diff --git a/cinder/volume/drivers/drbdmanagedrv.py b/cinder/volume/drivers/drbdmanagedrv.py index 306ce9297..aa994f298 100644 --- a/cinder/volume/drivers/drbdmanagedrv.py +++ b/cinder/volume/drivers/drbdmanagedrv.py @@ -507,7 +507,7 @@ class DrbdManageDriver(driver.VolumeDriver): volume, volume_path) - def create_export(self, context, volume): + def create_export(self, context, volume, connector): volume_path = self.local_path(volume) export_info = self.target_driver.create_export( context, diff --git a/cinder/volume/drivers/emc/emc_cli_fc.py b/cinder/volume/drivers/emc/emc_cli_fc.py index 9853e6da4..cc43fd911 100644 --- a/cinder/volume/drivers/emc/emc_cli_fc.py +++ b/cinder/volume/drivers/emc/emc_cli_fc.py @@ -109,7 +109,7 @@ class EMCCLIFCDriver(driver.FibreChannelDriver): """Driver entry point to get the export info for an existing volume.""" 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.""" pass diff --git a/cinder/volume/drivers/emc/emc_cli_iscsi.py b/cinder/volume/drivers/emc/emc_cli_iscsi.py index 507619623..19b9ac557 100644 --- a/cinder/volume/drivers/emc/emc_cli_iscsi.py +++ b/cinder/volume/drivers/emc/emc_cli_iscsi.py @@ -106,7 +106,7 @@ class EMCCLIISCSIDriver(driver.ISCSIDriver): """Driver entry point to get the export info for an existing volume.""" 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.""" pass diff --git a/cinder/volume/drivers/emc/emc_vmax_fc.py b/cinder/volume/drivers/emc/emc_vmax_fc.py index 7748abb17..08376cd3f 100644 --- a/cinder/volume/drivers/emc/emc_vmax_fc.py +++ b/cinder/volume/drivers/emc/emc_vmax_fc.py @@ -117,7 +117,7 @@ class EMCVMAXFCDriver(driver.FibreChannelDriver): """Driver entry point to get the export info for an existing volume.""" 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.""" pass diff --git a/cinder/volume/drivers/emc/emc_vmax_iscsi.py b/cinder/volume/drivers/emc/emc_vmax_iscsi.py index 1477392b8..cfae7121f 100644 --- a/cinder/volume/drivers/emc/emc_vmax_iscsi.py +++ b/cinder/volume/drivers/emc/emc_vmax_iscsi.py @@ -124,7 +124,7 @@ class EMCVMAXISCSIDriver(driver.ISCSIDriver): """Driver entry point to get the export info for an existing volume.""" 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.""" pass diff --git a/cinder/volume/drivers/emc/scaleio.py b/cinder/volume/drivers/emc/scaleio.py index 8da788732..d96ba836a 100644 --- a/cinder/volume/drivers/emc/scaleio.py +++ b/cinder/volume/drivers/emc/scaleio.py @@ -1141,7 +1141,7 @@ class ScaleIODriver(driver.VolumeDriver): """Driver entry point to get the export info for an existing volume.""" 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.""" pass diff --git a/cinder/volume/drivers/eqlx.py b/cinder/volume/drivers/eqlx.py index 74adebebe..51f941760 100644 --- a/cinder/volume/drivers/eqlx.py +++ b/cinder/volume/drivers/eqlx.py @@ -510,7 +510,7 @@ class DellEQLSanISCSIDriver(san.SanISCSIDriver): 'to volume "%s".'), volume['name']) - def create_export(self, context, volume): + def create_export(self, context, volume, connector): """Create an export of a volume. Driver has nothing to do here for the volume has been exported diff --git a/cinder/volume/drivers/glusterfs.py b/cinder/volume/drivers/glusterfs.py index 078344cdc..ca63a2a52 100644 --- a/cinder/volume/drivers/glusterfs.py +++ b/cinder/volume/drivers/glusterfs.py @@ -275,7 +275,7 @@ class GlusterfsDriver(remotefs_drv.RemoteFSSnapDriver, driver.CloneableVD, self._ensure_share_mounted(volume['provider_location']) - def create_export(self, ctx, volume): + def create_export(self, ctx, volume, connector): """Exports the volume.""" pass diff --git a/cinder/volume/drivers/hgst.py b/cinder/volume/drivers/hgst.py index 59b0b29f2..2c27037cb 100644 --- a/cinder/volume/drivers/hgst.py +++ b/cinder/volume/drivers/hgst.py @@ -585,7 +585,7 @@ class HGSTDriver(driver.VolumeDriver): """Query the provider_id to figure out the proper devnode.""" return "/dev/" + self._get_space_name(volume) - def create_export(self, context, volume): + def create_export(self, context, volume, connector): # Not needed for spaces pass diff --git a/cinder/volume/drivers/hitachi/hbsd_fc.py b/cinder/volume/drivers/hitachi/hbsd_fc.py index fee7332c0..00d51b25e 100644 --- a/cinder/volume/drivers/hitachi/hbsd_fc.py +++ b/cinder/volume/drivers/hitachi/hbsd_fc.py @@ -473,7 +473,7 @@ class HBSDFCDriver(cinder.volume.driver.FibreChannelDriver): def discard_zero_page(self, 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 def ensure_export(self, context, volume): diff --git a/cinder/volume/drivers/hitachi/hbsd_iscsi.py b/cinder/volume/drivers/hitachi/hbsd_iscsi.py index d2f063853..efb4ed0e7 100644 --- a/cinder/volume/drivers/hitachi/hbsd_iscsi.py +++ b/cinder/volume/drivers/hitachi/hbsd_iscsi.py @@ -384,7 +384,7 @@ class HBSDISCSIDriver(cinder.volume.driver.ISCSIDriver): self.common.volume_info[ldev]['in_use']: self._terminate_connection(ldev, connector, hostgroups) - def create_export(self, context, volume): + def create_export(self, context, volume, connector): pass def ensure_export(self, context, volume): diff --git a/cinder/volume/drivers/hitachi/hnas_iscsi.py b/cinder/volume/drivers/hitachi/hnas_iscsi.py index 925d72583..6427ac072 100644 --- a/cinder/volume/drivers/hitachi/hnas_iscsi.py +++ b/cinder/volume/drivers/hitachi/hnas_iscsi.py @@ -424,7 +424,7 @@ class HDSISCSIDriver(driver.ISCSIDriver): def ensure_export(self, context, volume): pass - def create_export(self, context, volume): + def create_export(self, context, volume, connector): """Create an export. Moved to initialize_connection. :param context: diff --git a/cinder/volume/drivers/huawei/huawei_driver.py b/cinder/volume/drivers/huawei/huawei_driver.py index 23b6bc557..30d2fbb9d 100644 --- a/cinder/volume/drivers/huawei/huawei_driver.py +++ b/cinder/volume/drivers/huawei/huawei_driver.py @@ -566,7 +566,7 @@ class HuaweiBaseDriver(driver.VolumeDriver): def migrate_volume(self, context, volume, host): return (False, None) - def create_export(self, context, volume): + def create_export(self, context, volume, connector): """Export a volume.""" pass diff --git a/cinder/volume/drivers/ibm/gpfs.py b/cinder/volume/drivers/ibm/gpfs.py index ae3853a39..1849c30cc 100644 --- a/cinder/volume/drivers/ibm/gpfs.py +++ b/cinder/volume/drivers/ibm/gpfs.py @@ -742,7 +742,7 @@ class GPFSDriver(driver.ConsistencyGroupVD, driver.ExtendVD, """Synchronously recreates an export for a logical volume.""" pass - def create_export(self, context, volume): + def create_export(self, context, volume, connector): """Exports the volume.""" pass diff --git a/cinder/volume/drivers/ibm/storwize_svc/__init__.py b/cinder/volume/drivers/ibm/storwize_svc/__init__.py index f78594113..5ef14515f 100644 --- a/cinder/volume/drivers/ibm/storwize_svc/__init__.py +++ b/cinder/volume/drivers/ibm/storwize_svc/__init__.py @@ -315,7 +315,7 @@ class StorwizeSVCDriver(san.SanDriver, LOG.error(_LE('ensure_export: Volume %s not found on storage.'), volume['name']) - def create_export(self, ctxt, volume): + def create_export(self, ctxt, volume, connector): model_update = None return model_update diff --git a/cinder/volume/drivers/ibm/xiv_ds8k.py b/cinder/volume/drivers/ibm/xiv_ds8k.py index 302955ec5..93a24e206 100644 --- a/cinder/volume/drivers/ibm/xiv_ds8k.py +++ b/cinder/volume/drivers/ibm/xiv_ds8k.py @@ -110,7 +110,7 @@ class XIVDS8KDriver(san.SanDriver, 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.""" return self.xiv_ds8k_proxy.create_export(context, volume) diff --git a/cinder/volume/drivers/infortrend/infortrend_fc_cli.py b/cinder/volume/drivers/infortrend/infortrend_fc_cli.py index 767c108c4..d4da587f3 100644 --- a/cinder/volume/drivers/infortrend/infortrend_fc_cli.py +++ b/cinder/volume/drivers/infortrend/infortrend_fc_cli.py @@ -123,7 +123,7 @@ class InfortrendCLIFCDriver(driver.FibreChannelDriver): """Synchronously recreates an export for a volume.""" pass - def create_export(self, context, volume): + def create_export(self, context, volume, connector): """Exports the volume. Can optionally return a Dictionary of changes diff --git a/cinder/volume/drivers/infortrend/infortrend_iscsi_cli.py b/cinder/volume/drivers/infortrend/infortrend_iscsi_cli.py index 07d97c4b1..18ba89392 100644 --- a/cinder/volume/drivers/infortrend/infortrend_iscsi_cli.py +++ b/cinder/volume/drivers/infortrend/infortrend_iscsi_cli.py @@ -121,7 +121,7 @@ class InfortrendCLIISCSIDriver(driver.ISCSIDriver): """Synchronously recreates an export for a volume.""" pass - def create_export(self, context, volume): + def create_export(self, context, volume, connector): """Exports the volume. Can optionally return a Dictionary of changes diff --git a/cinder/volume/drivers/lvm.py b/cinder/volume/drivers/lvm.py index a814a71f8..ff5a68c78 100644 --- a/cinder/volume/drivers/lvm.py +++ b/cinder/volume/drivers/lvm.py @@ -651,7 +651,7 @@ class LVMVolumeDriver(driver.VolumeDriver): self.target_driver.ensure_export(context, volume, volume_path) return model_update - def create_export(self, context, volume, vg=None): + def create_export(self, context, volume, connector, vg=None): if vg is None: vg = self.configuration.volume_group diff --git a/cinder/volume/drivers/netapp/dataontap/fc_7mode.py b/cinder/volume/drivers/netapp/dataontap/fc_7mode.py index 8b06e6216..3749c8607 100644 --- a/cinder/volume/drivers/netapp/dataontap/fc_7mode.py +++ b/cinder/volume/drivers/netapp/dataontap/fc_7mode.py @@ -68,7 +68,7 @@ class NetApp7modeFibreChannelDriver(driver.FibreChannelDriver): def ensure_export(self, 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) def remove_export(self, context, volume): diff --git a/cinder/volume/drivers/netapp/dataontap/fc_cmode.py b/cinder/volume/drivers/netapp/dataontap/fc_cmode.py index 856d8b510..13d60b614 100644 --- a/cinder/volume/drivers/netapp/dataontap/fc_cmode.py +++ b/cinder/volume/drivers/netapp/dataontap/fc_cmode.py @@ -68,7 +68,7 @@ class NetAppCmodeFibreChannelDriver(driver.FibreChannelDriver): def ensure_export(self, 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) def remove_export(self, context, volume): diff --git a/cinder/volume/drivers/netapp/dataontap/iscsi_7mode.py b/cinder/volume/drivers/netapp/dataontap/iscsi_7mode.py index 2a200f1cb..eebb20282 100644 --- a/cinder/volume/drivers/netapp/dataontap/iscsi_7mode.py +++ b/cinder/volume/drivers/netapp/dataontap/iscsi_7mode.py @@ -67,7 +67,7 @@ class NetApp7modeISCSIDriver(driver.ISCSIDriver): def ensure_export(self, 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) def remove_export(self, context, volume): diff --git a/cinder/volume/drivers/netapp/dataontap/iscsi_cmode.py b/cinder/volume/drivers/netapp/dataontap/iscsi_cmode.py index 482d05522..f4c6da7b8 100644 --- a/cinder/volume/drivers/netapp/dataontap/iscsi_cmode.py +++ b/cinder/volume/drivers/netapp/dataontap/iscsi_cmode.py @@ -67,7 +67,7 @@ class NetAppCmodeISCSIDriver(driver.ISCSIDriver): def ensure_export(self, 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) def remove_export(self, context, volume): diff --git a/cinder/volume/drivers/netapp/eseries/fc_driver.py b/cinder/volume/drivers/netapp/eseries/fc_driver.py index 1de849df6..3930afc19 100644 --- a/cinder/volume/drivers/netapp/eseries/fc_driver.py +++ b/cinder/volume/drivers/netapp/eseries/fc_driver.py @@ -75,7 +75,7 @@ class NetAppEseriesFibreChannelDriver(driver.BaseVD, def ensure_export(self, 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) def remove_export(self, context, volume): diff --git a/cinder/volume/drivers/netapp/eseries/iscsi_driver.py b/cinder/volume/drivers/netapp/eseries/iscsi_driver.py index bd1af9f77..df96bb1e2 100644 --- a/cinder/volume/drivers/netapp/eseries/iscsi_driver.py +++ b/cinder/volume/drivers/netapp/eseries/iscsi_driver.py @@ -77,7 +77,7 @@ class NetAppEseriesISCSIDriver(driver.BaseVD, def ensure_export(self, 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) def remove_export(self, context, volume): diff --git a/cinder/volume/drivers/nimble.py b/cinder/volume/drivers/nimble.py index df6236e2f..a32ccc152 100755 --- a/cinder/volume/drivers/nimble.py +++ b/cinder/volume/drivers/nimble.py @@ -227,7 +227,7 @@ class NimbleISCSIDriver(san.SanISCSIDriver): self._clone_volume_from_snapshot(volume, snapshot) 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.""" return self._get_model_info(volume['name']) diff --git a/cinder/volume/drivers/prophetstor/dplcommon.py b/cinder/volume/drivers/prophetstor/dplcommon.py index cf54a827a..a09b9a105 100644 --- a/cinder/volume/drivers/prophetstor/dplcommon.py +++ b/cinder/volume/drivers/prophetstor/dplcommon.py @@ -857,7 +857,7 @@ class DPLCOMMONDriver(driver.ConsistencyGroupVD, driver.ExtendVD, raise exception.VolumeBackendAPIException(data=msg) return snapshotID - def create_export(self, context, volume): + def create_export(self, context, volume, connector): pass def ensure_export(self, context, volume): diff --git a/cinder/volume/drivers/pure.py b/cinder/volume/drivers/pure.py index 7fa0f386b..28790703f 100644 --- a/cinder/volume/drivers/pure.py +++ b/cinder/volume/drivers/pure.py @@ -205,7 +205,7 @@ class PureBaseVolumeDriver(san.SanDriver): def ensure_export(self, context, volume): pass - def create_export(self, context, volume): + def create_export(self, context, volume, connector): pass def _get_host(self, connector): diff --git a/cinder/volume/drivers/rbd.py b/cinder/volume/drivers/rbd.py index 2ffb22e17..c94294ea7 100644 --- a/cinder/volume/drivers/rbd.py +++ b/cinder/volume/drivers/rbd.py @@ -790,7 +790,7 @@ class RBDDriver(driver.RetypeVD, driver.TransferVD, driver.ExtendVD, """Synchronously recreates an export for a logical volume.""" pass - def create_export(self, context, volume): + def create_export(self, context, volume, connector): """Exports the volume.""" pass diff --git a/cinder/volume/drivers/remotefs.py b/cinder/volume/drivers/remotefs.py index 78e76b178..c35e0b2f0 100644 --- a/cinder/volume/drivers/remotefs.py +++ b/cinder/volume/drivers/remotefs.py @@ -281,7 +281,7 @@ class RemoteFSDriver(driver.LocalVD, driver.TransferVD, driver.BaseVD): """Synchronously recreates an export for a logical volume.""" self._ensure_share_mounted(volume['provider_location']) - def create_export(self, ctx, volume): + def create_export(self, ctx, volume, connector): """Exports the volume. Can optionally return a dictionary of changes diff --git a/cinder/volume/drivers/san/hp/hp_3par_fc.py b/cinder/volume/drivers/san/hp/hp_3par_fc.py index db6c547f0..fc1e7ae35 100644 --- a/cinder/volume/drivers/san/hp/hp_3par_fc.py +++ b/cinder/volume/drivers/san/hp/hp_3par_fc.py @@ -411,7 +411,7 @@ class HP3PARFCDriver(cinder.volume.driver.FibreChannelDriver): host = common._get_3par_host(host['name']) return host - def create_export(self, context, volume): + def create_export(self, context, volume, connector): pass def ensure_export(self, context, volume): diff --git a/cinder/volume/drivers/san/hp/hp_3par_iscsi.py b/cinder/volume/drivers/san/hp/hp_3par_iscsi.py index a51f837c4..0d7868fe2 100644 --- a/cinder/volume/drivers/san/hp/hp_3par_iscsi.py +++ b/cinder/volume/drivers/san/hp/hp_3par_iscsi.py @@ -554,7 +554,7 @@ class HP3PARISCSIDriver(cinder.volume.driver.ISCSIDriver): return model_update - def create_export(self, context, volume): + def create_export(self, context, volume, connector): common = self._login() try: return self._do_export(common, volume) diff --git a/cinder/volume/drivers/san/hp/hp_lefthand_cliq_proxy.py b/cinder/volume/drivers/san/hp/hp_lefthand_cliq_proxy.py index 884e8d6d0..c4b635bea 100644 --- a/cinder/volume/drivers/san/hp/hp_lefthand_cliq_proxy.py +++ b/cinder/volume/drivers/san/hp/hp_lefthand_cliq_proxy.py @@ -450,7 +450,7 @@ class HPLeftHandCLIQProxy(san.SanISCSIDriver): def create_cloned_volume(self, volume, src_vref): raise NotImplementedError() - def create_export(self, context, volume): + def create_export(self, context, volume, connector): pass def ensure_export(self, context, volume): diff --git a/cinder/volume/drivers/san/hp/hp_lefthand_iscsi.py b/cinder/volume/drivers/san/hp/hp_lefthand_iscsi.py index 1bd35797b..ed118ec5d 100644 --- a/cinder/volume/drivers/san/hp/hp_lefthand_iscsi.py +++ b/cinder/volume/drivers/san/hp/hp_lefthand_iscsi.py @@ -148,8 +148,8 @@ class HPLeftHandISCSIDriver(driver.TransferVD, def create_cloned_volume(self, volume, src_vref): return self.proxy.create_cloned_volume(volume, src_vref) - def create_export(self, context, volume): - return self.proxy.create_export(context, volume) + def create_export(self, context, volume, connector): + return self.proxy.create_export(context, volume, connector) def ensure_export(self, context, volume): return self.proxy.ensure_export(context, volume) diff --git a/cinder/volume/drivers/san/hp/hp_lefthand_rest_proxy.py b/cinder/volume/drivers/san/hp/hp_lefthand_rest_proxy.py index 4c4dfef41..ff32fbe0d 100644 --- a/cinder/volume/drivers/san/hp/hp_lefthand_rest_proxy.py +++ b/cinder/volume/drivers/san/hp/hp_lefthand_rest_proxy.py @@ -508,7 +508,7 @@ class HPLeftHandRESTProxy(driver.ISCSIDriver): optional) return server_info - def create_export(self, context, volume): + def create_export(self, context, volume, connector): pass def ensure_export(self, context, volume): diff --git a/cinder/volume/drivers/san/hp/hp_xp_fc.py b/cinder/volume/drivers/san/hp/hp_xp_fc.py index b67f5d952..ea2f6f478 100644 --- a/cinder/volume/drivers/san/hp/hp_xp_fc.py +++ b/cinder/volume/drivers/san/hp/hp_xp_fc.py @@ -134,7 +134,7 @@ class HPXPFCDriver(driver.FibreChannelDriver): def ensure_export(self, context, volume): pass - def create_export(self, context, volume): + def create_export(self, context, volume, connector): pass def remove_export(self, context, volume): diff --git a/cinder/volume/drivers/san/san.py b/cinder/volume/drivers/san/san.py index a92f81bfd..6707a0f54 100644 --- a/cinder/volume/drivers/san/san.py +++ b/cinder/volume/drivers/san/san.py @@ -153,7 +153,7 @@ class SanDriver(driver.BaseVD): """Synchronously recreates an export for a logical volume.""" pass - def create_export(self, context, volume): + def create_export(self, context, volume, connector): """Exports the volume.""" pass diff --git a/cinder/volume/drivers/scality.py b/cinder/volume/drivers/scality.py index a03fb6509..904f18ba1 100644 --- a/cinder/volume/drivers/scality.py +++ b/cinder/volume/drivers/scality.py @@ -194,7 +194,7 @@ class ScalityDriver(driver.VolumeDriver): """Synchronously recreates an export for a logical volume.""" pass - def create_export(self, context, volume): + def create_export(self, context, volume, connector): """Exports the volume. Can optionally return a Dictionary of changes to the volume diff --git a/cinder/volume/drivers/sheepdog.py b/cinder/volume/drivers/sheepdog.py index bd5dee3c2..a20ce25c8 100644 --- a/cinder/volume/drivers/sheepdog.py +++ b/cinder/volume/drivers/sheepdog.py @@ -218,7 +218,7 @@ class SheepdogDriver(driver.VolumeDriver): """Safely and synchronously recreate an export for a logical volume.""" pass - def create_export(self, context, volume): + def create_export(self, context, volume, connector): """Export a volume.""" pass diff --git a/cinder/volume/drivers/solidfire.py b/cinder/volume/drivers/solidfire.py index 1efb6ee9c..e330d9892 100644 --- a/cinder/volume/drivers/solidfire.py +++ b/cinder/volume/drivers/solidfire.py @@ -1229,7 +1229,7 @@ class SolidFireDriver(san.SanISCSIDriver): def ensure_export(self, context, volume): 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( context, volume, diff --git a/cinder/volume/drivers/srb.py b/cinder/volume/drivers/srb.py index 75436e022..8d1630768 100644 --- a/cinder/volume/drivers/srb.py +++ b/cinder/volume/drivers/srb.py @@ -850,7 +850,7 @@ class SRBISCSIDriver(SRBDriver, driver.ISCSIDriver): if 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.""" self._attach_file(volume) vg = self._get_lvm_vg(volume) diff --git a/cinder/volume/drivers/storpool.py b/cinder/volume/drivers/storpool.py index ae49beaf8..c152fa2a7 100644 --- a/cinder/volume/drivers/storpool.py +++ b/cinder/volume/drivers/storpool.py @@ -183,7 +183,7 @@ class StorPoolDriver(driver.TransferVD, driver.ExtendVD, driver.CloneableVD, "%(msg)s"), {'name': snapname, 'msg': e}) - def create_export(self, context, volume): + def create_export(self, context, volume, connector): pass def remove_export(self, context, volume): diff --git a/cinder/volume/drivers/violin/v6000_fcp.py b/cinder/volume/drivers/violin/v6000_fcp.py index 7e7953b8d..af19efa3b 100644 --- a/cinder/volume/drivers/violin/v6000_fcp.py +++ b/cinder/volume/drivers/violin/v6000_fcp.py @@ -125,7 +125,7 @@ class V6000FCDriver(driver.FibreChannelDriver): """Synchronously checks and re-exports volumes at cinder start time.""" pass - def create_export(self, context, volume): + def create_export(self, context, volume, connector): """Exports the volume.""" pass diff --git a/cinder/volume/drivers/violin/v6000_iscsi.py b/cinder/volume/drivers/violin/v6000_iscsi.py index 770f39ee0..aa525e9c7 100644 --- a/cinder/volume/drivers/violin/v6000_iscsi.py +++ b/cinder/volume/drivers/violin/v6000_iscsi.py @@ -150,7 +150,7 @@ class V6000ISCSIDriver(driver.ISCSIDriver): """Synchronously checks and re-exports volumes at cinder start time.""" pass - def create_export(self, context, volume): + def create_export(self, context, volume, connector): """Exports the volume.""" pass diff --git a/cinder/volume/drivers/violin/v7000_fcp.py b/cinder/volume/drivers/violin/v7000_fcp.py index 30d7d2c34..f6aef8a9c 100644 --- a/cinder/volume/drivers/violin/v7000_fcp.py +++ b/cinder/volume/drivers/violin/v7000_fcp.py @@ -122,7 +122,7 @@ class V7000FCPDriver(driver.FibreChannelDriver): """Synchronously checks and re-exports volumes at cinder start time.""" pass - def create_export(self, context, volume): + def create_export(self, context, volume, connector): """Exports the volume.""" pass diff --git a/cinder/volume/drivers/vmware/vmdk.py b/cinder/volume/drivers/vmware/vmdk.py index 79edb36f0..20cdc5933 100644 --- a/cinder/volume/drivers/vmware/vmdk.py +++ b/cinder/volume/drivers/vmware/vmdk.py @@ -587,7 +587,7 @@ class VMwareEsxVmdkDriver(driver.VolumeDriver): def terminate_connection(self, volume, connector, force=False, **kwargs): pass - def create_export(self, context, volume): + def create_export(self, context, volume, connector): pass def ensure_export(self, context, volume): diff --git a/cinder/volume/drivers/windows/windows.py b/cinder/volume/drivers/windows/windows.py index 192728fc2..c5d9efa27 100644 --- a/cinder/volume/drivers/windows/windows.py +++ b/cinder/volume/drivers/windows/windows.py @@ -133,7 +133,7 @@ class WindowsDriver(driver.ISCSIDriver): # iSCSI targets exported by WinTarget persist after host reboot. 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.""" # Since the iSCSI targets are not reused, being deleted when the # volume is detached, we should clean up existing targets before diff --git a/cinder/volume/drivers/xio.py b/cinder/volume/drivers/xio.py index 6dd693d07..92aad19ba 100644 --- a/cinder/volume/drivers/xio.py +++ b/cinder/volume/drivers/xio.py @@ -1486,7 +1486,7 @@ class XIOISEISCSIDriver(driver.ISCSIDriver): def delete_snapshot(self, 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) def ensure_export(self, context, volume): @@ -1595,7 +1595,7 @@ class XIOISEFCDriver(driver.FibreChannelDriver): def delete_snapshot(self, 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) def ensure_export(self, context, volume): diff --git a/cinder/volume/drivers/zfssa/zfssaiscsi.py b/cinder/volume/drivers/zfssa/zfssaiscsi.py index 933daac9d..671c3b26f 100644 --- a/cinder/volume/drivers/zfssa/zfssaiscsi.py +++ b/cinder/volume/drivers/zfssa/zfssaiscsi.py @@ -366,7 +366,7 @@ class ZFSSAISCSIDriver(driver.ISCSIDriver): self._update_volume_status() return self._stats - def create_export(self, context, volume): + def create_export(self, context, volume, connector): pass def remove_export(self, context, volume): diff --git a/cinder/volume/manager.py b/cinder/volume/manager.py index 3b937939f..6c5db7ffe 100644 --- a/cinder/volume/manager.py +++ b/cinder/volume/manager.py @@ -1085,7 +1085,7 @@ class VolumeManager(manager.SchedulerDependentManager): try: model_update = self.driver.create_export(context.elevated(), - volume) + volume, connector) except exception.CinderException: err_msg = (_("Create export for volume failed.")) LOG.exception(err_msg, resource=volume) -- 2.45.2