From d24bc359121ef9fa7a1d279ef3183e0831d49fb6 Mon Sep 17 00:00:00 2001 From: Nate Potter Date: Fri, 8 Jan 2016 20:52:02 +0000 Subject: [PATCH] Remove access_mode 'rw' setting in drivers The volume manager sets the initiator access mode in initialize_connection, so drivers should not hardcode this setting to 'rw'. This patch removes code from drivers that override the access_mode. Change-Id: I634cb914635ee90114a511f942c4d7be51d7a36d Closes-bug: #1526152 --- cinder/tests/unit/test_dellscapi.py | 30 +++++++------------ cinder/tests/unit/test_infortrend_cli.py | 5 ---- cinder/tests/unit/test_pure.py | 2 -- cinder/tests/unit/test_tegile.py | 6 ++-- cinder/tests/unit/test_xio.py | 6 ---- cinder/volume/driver.py | 9 ------ .../drivers/dell/dell_storagecenter_api.py | 10 ++----- .../drivers/dell/dell_storagecenter_iscsi.py | 1 - cinder/volume/drivers/emc/emc_cli_fc.py | 2 -- cinder/volume/drivers/emc/emc_cli_iscsi.py | 2 -- cinder/volume/drivers/emc/xtremio.py | 2 -- .../infortrend/eonstor_ds_cli/common_cli.py | 1 - .../drivers/infortrend/infortrend_fc_cli.py | 2 -- .../infortrend/infortrend_iscsi_cli.py | 1 - .../volume/drivers/prophetstor/dpl_iscsi.py | 1 - cinder/volume/drivers/pure.py | 2 -- cinder/volume/drivers/tegile.py | 2 -- cinder/volume/drivers/violin/v7000_fcp.py | 1 - cinder/volume/drivers/xio.py | 1 - cinder/volume/manager.py | 15 +++++----- cinder/volume/targets/iscsi.py | 4 --- 21 files changed, 22 insertions(+), 83 deletions(-) diff --git a/cinder/tests/unit/test_dellscapi.py b/cinder/tests/unit/test_dellscapi.py index 50977836d..ebb3d5dd7 100644 --- a/cinder/tests/unit/test_dellscapi.py +++ b/cinder/tests/unit/test_dellscapi.py @@ -3194,8 +3194,7 @@ class DellSCSanAPITestCase(test.TestCase): self.assertTrue(mock_find_domains.called) self.assertTrue(mock_find_ctrl_port.called) self.assertTrue(mock_find_active_controller.called) - expected = {'access_mode': 'rw', - 'target_discovered': False, + expected = {'target_discovered': False, 'target_iqn': u'iqn.2002-03.com.compellent:5000d31000fcbe43', 'target_iqns': @@ -3238,8 +3237,7 @@ class DellSCSanAPITestCase(test.TestCase): self.assertTrue(mock_find_domains.called) self.assertTrue(mock_find_ctrl_port.called) self.assertTrue(mock_find_active_controller.called) - expected = {'access_mode': 'rw', - 'target_discovered': False, + expected = {'target_discovered': False, 'target_iqn': u'iqn.2002-03.com.compellent:5000d31000fcbe43', 'target_iqns': @@ -3283,8 +3281,7 @@ class DellSCSanAPITestCase(test.TestCase): self.assertTrue(mock_find_domains.called) self.assertTrue(mock_find_ctrl_port.called) self.assertTrue(mock_find_active_ctrl.called) - expected = {'access_mode': 'rw', - 'target_discovered': False, + expected = {'target_discovered': False, 'target_iqn': u'iqn.2002-03.com.compellent:5000d31000fcbe43', 'target_iqns': @@ -3403,8 +3400,7 @@ class DellSCSanAPITestCase(test.TestCase): self.assertTrue(mock_find_domains.called) self.assertTrue(mock_find_ctrl_port.called) self.assertTrue(mock_find_active_controller.called) - expected = {'access_mode': 'ro', - 'target_discovered': False, + expected = {'target_discovered': False, 'target_iqn': u'iqn.2002-03.com.compellent:5000d31000fcbe43', 'target_iqns': @@ -3446,8 +3442,7 @@ class DellSCSanAPITestCase(test.TestCase): self.assertTrue(mock_find_ctrl_port.called) self.assertTrue(mock_find_active_controller.called) self.assertTrue(mock_is_virtualport_mode.called) - expected = {'access_mode': 'rw', - 'target_discovered': False, + expected = {'target_discovered': False, 'target_iqn': u'iqn.2002-03.com.compellent:5000d31000fcbe43', 'target_iqns': @@ -3495,8 +3490,7 @@ class DellSCSanAPITestCase(test.TestCase): self.assertTrue(mock_find_ctrl_port.called) self.assertTrue(mock_find_controller_port_iscsi_config.called) self.assertTrue(mock_find_active_controller.called) - expected = {'access_mode': 'rw', - 'target_discovered': False, + expected = {'target_discovered': False, 'target_iqn': u'iqn.2002-03.com.compellent:5000d31000fcbe43', 'target_iqns': @@ -3574,8 +3568,7 @@ class DellSCSanAPITestCase(test.TestCase): self.assertTrue(mock_find_ctrl_port.called) self.assertTrue(mock_find_active_controller.called) self.assertTrue(mock_find_controller_port_iscsi_config.called) - expected = {'access_mode': 'rw', - 'target_discovered': False, + expected = {'target_discovered': False, 'target_iqn': u'iqn.2002-03.com.compellent:5000d31000fcbe43', 'target_iqns': @@ -3619,8 +3612,7 @@ class DellSCSanAPITestCase(test.TestCase): self.assertTrue(mock_find_ctrl_port.called) self.assertTrue(mock_find_active_ctrl.called) self.assertTrue(mock_find_controller_port_iscsi_config.called) - expected = {'access_mode': 'rw', - 'target_discovered': False, + expected = {'target_discovered': False, 'target_iqn': u'iqn.2002-03.com.compellent:5000d31000fcbe43', 'target_iqns': @@ -3662,8 +3654,7 @@ class DellSCSanAPITestCase(test.TestCase): self.assertTrue(mock_find_ctrl_port.called) self.assertTrue(mock_find_active_controller.called) self.assertTrue(mock_find_iscsi_config.called) - expected = {'access_mode': 'ro', - 'target_discovered': False, + expected = {'target_discovered': False, 'target_iqn': u'iqn.2002-03.com.compellent:5000d31000fcbe43', 'target_iqns': @@ -3708,8 +3699,7 @@ class DellSCSanAPITestCase(test.TestCase): self.assertTrue(mock_find_controller_port_iscsi_config.called) # Since we're feeding the same info back multiple times the information # will be duped. - expected = {'access_mode': 'rw', - 'target_discovered': False, + expected = {'target_discovered': False, 'target_iqn': u'iqn.2002-03.com.compellent:5000d31000fcbe43', 'target_iqns': diff --git a/cinder/tests/unit/test_infortrend_cli.py b/cinder/tests/unit/test_infortrend_cli.py index 0e7614773..3534385eb 100644 --- a/cinder/tests/unit/test_infortrend_cli.py +++ b/cinder/tests/unit/test_infortrend_cli.py @@ -176,7 +176,6 @@ class InfortrendCLITestData(object): 'target_discovered': True, 'target_lun': fake_lun_map[0], 'target_wwn': fake_target_wwpns[0:2], - 'access_mode': 'rw', 'initiator_target_map': test_initiator_target_map, }, } @@ -192,7 +191,6 @@ class InfortrendCLITestData(object): 'target_discovered': True, 'target_lun': fake_lun_map[0], 'target_wwn': [fake_target_wwpns[1]], - 'access_mode': 'rw', 'initiator_target_map': test_initiator_target_map_specific_channel, }, } @@ -215,7 +213,6 @@ class InfortrendCLITestData(object): 'target_discovered': True, 'target_lun': fake_lun_map[0], 'target_wwn': test_target_wwpns_map_multipath_r_model[:], - 'access_mode': 'rw', 'initiator_target_map': test_initiator_target_map_multipath_r_model, }, @@ -234,7 +231,6 @@ class InfortrendCLITestData(object): 'target_discovered': True, 'target_lun': fake_lun_map[0], 'target_wwn': [x.lower() for x in fake_target_wwpns[0:2]], - 'access_mode': 'rw', 'initiator_target_map': test_initiator_target_map_zoning, }, } @@ -252,7 +248,6 @@ class InfortrendCLITestData(object): 'target_discovered': True, 'target_lun': fake_lun_map[0], 'target_wwn': [x.lower() for x in fake_target_wwpns[1:3]], - 'access_mode': 'rw', 'initiator_target_map': test_initiator_target_map_zoning_r_model, }, } diff --git a/cinder/tests/unit/test_pure.py b/cinder/tests/unit/test_pure.py index f4eb7956e..4e8de97e9 100644 --- a/cinder/tests/unit/test_pure.py +++ b/cinder/tests/unit/test_pure.py @@ -169,7 +169,6 @@ ISCSI_CONNECTION_INFO = { "driver_volume_type": "iscsi", "data": { "target_discovered": False, - "access_mode": "rw", "discard": True, "target_luns": [1, 1, 1, 1], "target_iqns": [TARGET_IQN, TARGET_IQN, TARGET_IQN, TARGET_IQN], @@ -185,7 +184,6 @@ FC_CONNECTION_INFO = { "target_wwn": FC_WWNS, "target_lun": 1, "target_discovered": True, - "access_mode": "rw", "initiator_target_map": INITIATOR_TARGET_MAP, "discard": True, }, diff --git a/cinder/tests/unit/test_tegile.py b/cinder/tests/unit/test_tegile.py index 1f1a198dd..82c483246 100644 --- a/cinder/tests/unit/test_tegile.py +++ b/cinder/tests/unit/test_tegile.py @@ -356,8 +356,7 @@ class TegileISCSIDriverTestCase(test.TestCase): '_api_executor', fake_tegile_backend): self.assertEqual( - {'data': {'access_mode': 'rw', - 'auth_method': 'CHAP', + {'data': {'auth_method': 'CHAP', 'discard': False, 'target_discovered': (False,), 'auth_password': 'test', @@ -388,8 +387,7 @@ class TegileFCDriverTestCase(test.TestCase): with mock.patch.object(tegile_driver, '_api_executor', fake_tegile_backend): - self.assertEqual({'data': {'access_mode': 'rw', - 'encrypted': False, + self.assertEqual({'data': {'encrypted': False, 'initiator_target_map': { '21000024ff59bb6e': ['21000024ff578701'], diff --git a/cinder/tests/unit/test_xio.py b/cinder/tests/unit/test_xio.py index 9c922821f..e7f5d2bb4 100644 --- a/cinder/tests/unit/test_xio.py +++ b/cinder/tests/unit/test_xio.py @@ -1040,7 +1040,6 @@ class XIOISEDriverTestCase(object): exp_result = {"driver_volume_type": "iscsi", "data": {"target_lun": '1', "volume_id": '1', - "access_mode": 'rw', "target_discovered": False, "target_iqn": ISE_IQN, "target_portal": ISE_ISCSI_IP1 + ":3260"}} @@ -1048,7 +1047,6 @@ class XIOISEDriverTestCase(object): exp_result = {"driver_volume_type": "fibre_channel", "data": {"target_lun": '1', "volume_id": '1', - "access_mode": 'rw', "target_discovered": True, "initiator_target_map": ISE_INIT_TARGET_MAP, "target_wwn": ISE_TARGETS}} @@ -1071,7 +1069,6 @@ class XIOISEDriverTestCase(object): exp_result = {"driver_volume_type": "iscsi", "data": {"target_lun": '1', "volume_id": '1', - "access_mode": 'rw', "target_discovered": False, "target_iqn": ISE_IQN, "target_portal": ISE_ISCSI_IP1 + ":3260"}} @@ -1079,7 +1076,6 @@ class XIOISEDriverTestCase(object): exp_result = {"driver_volume_type": "fibre_channel", "data": {"target_lun": '1', "volume_id": '1', - "access_mode": 'rw', "target_discovered": True, "initiator_target_map": ISE_INIT_TARGET_MAP, "target_wwn": ISE_TARGETS}} @@ -1102,7 +1098,6 @@ class XIOISEDriverTestCase(object): exp_result = {"driver_volume_type": "iscsi", "data": {"target_lun": '1', "volume_id": '2', - "access_mode": 'rw', "target_discovered": False, "target_iqn": ISE_IQN, "target_portal": ISE_ISCSI_IP1 + ":3260", @@ -1113,7 +1108,6 @@ class XIOISEDriverTestCase(object): exp_result = {"driver_volume_type": "fibre_channel", "data": {"target_lun": '1', "volume_id": '2', - "access_mode": 'rw', "target_discovered": True, "initiator_target_map": ISE_INIT_TARGET_MAP, "target_wwn": ISE_TARGETS}} diff --git a/cinder/volume/driver.py b/cinder/volume/driver.py index dc579eed1..964048f06 100644 --- a/cinder/volume/driver.py +++ b/cinder/volume/driver.py @@ -2427,9 +2427,6 @@ class ISCSIDriver(VolumeDriver): present meaning no authentication, or auth_method == `CHAP` meaning use CHAP with the specified credentials. - :access_mode: the volume access mode allow client used - ('rw' or 'ro' currently supported) - :discard: boolean indicating if discard is supported In some of drivers that support multiple connections (for multipath @@ -2546,7 +2543,6 @@ class ISCSIDriver(VolumeDriver): 'target_iqn': 'iqn.2010-10.org.openstack:volume-00000001', 'target_portal': '127.0.0.0.1:3260', 'volume_id': 1, - 'access_mode': 'rw', 'discard': False, } } @@ -2567,7 +2563,6 @@ class ISCSIDriver(VolumeDriver): 'target_lun': 1, 'target_luns': [1, 1], 'volume_id': 1, - 'access_mode': 'rw', 'discard': False, } } @@ -2651,14 +2646,12 @@ class FakeISCSIDriver(ISCSIDriver): def initialize_connection(self, volume, connector): return { 'driver_volume_type': 'iscsi', - 'data': {'access_mode': 'rw'}, 'discard': False, } def initialize_connection_snapshot(self, snapshot, connector): return { 'driver_volume_type': 'iscsi', - 'data': {'access_mode': 'rw'} } def terminate_connection(self, volume, connector, **kwargs): @@ -2829,7 +2822,6 @@ class FibreChannelDriver(VolumeDriver): 'target_discovered': True, 'target_lun': 1, 'target_wwn': '1234567890123', - 'access_mode': 'rw', 'discard': False, } } @@ -2842,7 +2834,6 @@ class FibreChannelDriver(VolumeDriver): 'target_discovered': True, 'target_lun': 1, 'target_wwn': ['1234567890123', '0987654321321'], - 'access_mode': 'rw', 'discard': False, } } diff --git a/cinder/volume/drivers/dell/dell_storagecenter_api.py b/cinder/volume/drivers/dell/dell_storagecenter_api.py index 47b85ddcb..8ace33659 100644 --- a/cinder/volume/drivers/dell/dell_storagecenter_api.py +++ b/cinder/volume/drivers/dell/dell_storagecenter_api.py @@ -1272,7 +1272,6 @@ class StorageCenterApi(object): # Our mutable process object. pdata = {'active': -1, 'up': -1, - 'access_mode': 'rw', 'ip': ip, 'port': port} # Our output lists. @@ -1281,7 +1280,7 @@ class StorageCenterApi(object): iqns = [] # Process just looks for the best port to return. - def process(lun, iqn, address, port, readonly, status, active): + def process(lun, iqn, address, port, status, active): """Process this mapping information. :param lun: SCSI Lun. @@ -1312,7 +1311,6 @@ class StorageCenterApi(object): # but we don't actually need the state to be # up at this point. if pdata['up'] == -1: - pdata['access_mode'] = 'rw' if readonly is False else 'ro' if active: pdata['active'] = len(iqns) - 1 if status == 'Up': @@ -1336,7 +1334,6 @@ class StorageCenterApi(object): # The lun, ro mode and status are in the mapping. LOG.debug('mapping: %s', mapping) lun = mapping.get('lun') - ro = mapping.get('readOnly', False) status = mapping.get('status') # Get our IQN from our mapping. iqn = self._get_iqn(mapping) @@ -1354,7 +1351,7 @@ class StorageCenterApi(object): portnumber = dom.get('portNumber') # We have all our information. Process this portal. process(lun, iqn, ipaddress, portnumber, - ro, status, isactive) + status, isactive) # Else we are in legacy mode. elif iqn: # Need to get individual ports @@ -1368,7 +1365,7 @@ class StorageCenterApi(object): portnumber = cpconfig.get('portNumber') # We have all our information. Process this portal. process(lun, iqn, ipaddress, portnumber, - ro, status, isactive) + status, isactive) # We've gone through all our mappings. # Make sure we found something to return. @@ -1398,7 +1395,6 @@ class StorageCenterApi(object): 'target_portals': portals, 'target_lun': luns[pdata['active']], 'target_luns': luns, - 'access_mode': pdata['access_mode'] } LOG.debug('find_iscsi_properties return: %s', data) diff --git a/cinder/volume/drivers/dell/dell_storagecenter_iscsi.py b/cinder/volume/drivers/dell/dell_storagecenter_iscsi.py index 0da98c9a6..27f5fc8ae 100644 --- a/cinder/volume/drivers/dell/dell_storagecenter_iscsi.py +++ b/cinder/volume/drivers/dell/dell_storagecenter_iscsi.py @@ -65,7 +65,6 @@ class DellStorageCenterISCSIDriver(dell_storagecenter_common.DellCommonDriver, # 'target_portals': all portals, # 'target_lun': preferred lun, # 'target_luns': all luns, - # 'access_mode': access_mode # } # We use id to name the volume name as it is a diff --git a/cinder/volume/drivers/emc/emc_cli_fc.py b/cinder/volume/drivers/emc/emc_cli_fc.py index 37737b51c..db919bb5d 100644 --- a/cinder/volume/drivers/emc/emc_cli_fc.py +++ b/cinder/volume/drivers/emc/emc_cli_fc.py @@ -144,7 +144,6 @@ class EMCCLIFCDriver(driver.FibreChannelDriver): 'target_discovered': True, 'target_lun': 1, 'target_wwn': '1234567890123', - 'access_mode': 'rw' 'initiator_target_map': { '1122334455667788': ['1234567890123'] } @@ -159,7 +158,6 @@ class EMCCLIFCDriver(driver.FibreChannelDriver): 'target_discovered': True, 'target_lun': 1, 'target_wwn': ['1234567890123', '0987654321321'], - 'access_mode': 'rw' 'initiator_target_map': { '1122334455667788': ['1234567890123', '0987654321321'] diff --git a/cinder/volume/drivers/emc/emc_cli_iscsi.py b/cinder/volume/drivers/emc/emc_cli_iscsi.py index eb6bc221b..5b0ff9214 100644 --- a/cinder/volume/drivers/emc/emc_cli_iscsi.py +++ b/cinder/volume/drivers/emc/emc_cli_iscsi.py @@ -135,7 +135,6 @@ class EMCCLIISCSIDriver(driver.ISCSIDriver): 'target_iqn': 'iqn.2010-10.org.openstack:volume-00000001', 'target_portal': '127.0.0.0.1:3260', 'target_lun': 1, - 'access_mode': 'rw' } } @@ -149,7 +148,6 @@ class EMCCLIISCSIDriver(driver.ISCSIDriver): 'iqn.2010-10.org.openstack:volume-00002'], 'target_portals': ['127.0.0.1:3260', '127.0.1.1:3260'], 'target_luns': [1, 1], - 'access_mode': 'rw' } } diff --git a/cinder/volume/drivers/emc/xtremio.py b/cinder/volume/drivers/emc/xtremio.py index 362ca3dae..707c23899 100644 --- a/cinder/volume/drivers/emc/xtremio.py +++ b/cinder/volume/drivers/emc/xtremio.py @@ -842,8 +842,6 @@ class XtremIOISCSIDriver(XtremIOVolumeDriver, driver.ISCSIDriver): the authentication details. Right now, either auth_method is not present meaning no authentication, or auth_method == `CHAP` meaning use CHAP with the specified credentials. - :access_mode: the volume access mode allow client used - ('rw' or 'ro' currently supported) multiple connection return :target_iqns, :target_portals, :target_luns, which contain lists of multiple values. The main portal information is also returned in diff --git a/cinder/volume/drivers/infortrend/eonstor_ds_cli/common_cli.py b/cinder/volume/drivers/infortrend/eonstor_ds_cli/common_cli.py index 42fc3f689..a38f863de 100644 --- a/cinder/volume/drivers/infortrend/eonstor_ds_cli/common_cli.py +++ b/cinder/volume/drivers/infortrend/eonstor_ds_cli/common_cli.py @@ -1346,7 +1346,6 @@ class InfortrendCommon(object): 'target_discovered': True, 'target_lun': int(lun_id), 'target_wwn': target_wwpns, - 'access_mode': 'rw', 'initiator_target_map': initiator_target_map, }, } diff --git a/cinder/volume/drivers/infortrend/infortrend_fc_cli.py b/cinder/volume/drivers/infortrend/infortrend_fc_cli.py index c783ad03c..23766a21e 100644 --- a/cinder/volume/drivers/infortrend/infortrend_fc_cli.py +++ b/cinder/volume/drivers/infortrend/infortrend_fc_cli.py @@ -158,7 +158,6 @@ class InfortrendCLIFCDriver(driver.FibreChannelDriver): 'target_discovered': True, 'target_lun': 1, 'target_wwn': '1234567890123', - 'access_mode': 'rw' 'initiator_target_map': { '1122334455667788': ['1234567890123'] } @@ -173,7 +172,6 @@ class InfortrendCLIFCDriver(driver.FibreChannelDriver): 'target_discovered': True, 'target_lun': 1, 'target_wwn': ['1234567890123', '0987654321321'], - 'access_mode': 'rw' 'initiator_target_map': { '1122334455667788': ['1234567890123', '0987654321321'] diff --git a/cinder/volume/drivers/infortrend/infortrend_iscsi_cli.py b/cinder/volume/drivers/infortrend/infortrend_iscsi_cli.py index 3430047e5..cc380bb84 100644 --- a/cinder/volume/drivers/infortrend/infortrend_iscsi_cli.py +++ b/cinder/volume/drivers/infortrend/infortrend_iscsi_cli.py @@ -150,7 +150,6 @@ class InfortrendCLIISCSIDriver(driver.ISCSIDriver): 'target_iqn': 'iqn.2010-10.org.openstack:volume-00000001', 'target_portal': '127.0.0.0.1:3260', 'volume_id': 1, - 'access_mode': 'rw' } } """ diff --git a/cinder/volume/drivers/prophetstor/dpl_iscsi.py b/cinder/volume/drivers/prophetstor/dpl_iscsi.py index 157fa3f6b..ed6eb5061 100644 --- a/cinder/volume/drivers/prophetstor/dpl_iscsi.py +++ b/cinder/volume/drivers/prophetstor/dpl_iscsi.py @@ -38,7 +38,6 @@ class DPLISCSIDriver(dplcommon.DPLCOMMONDriver, properties['target_portal'] = '' properties['target_iqn'] = None properties['volume_id'] = volume['id'] - properties['access_mode'] = 'rw' dpl_server = self.configuration.san_ip dpl_iscsi_port = self.configuration.iscsi_port diff --git a/cinder/volume/drivers/pure.py b/cinder/volume/drivers/pure.py index f32916ce3..e5e121902 100644 --- a/cinder/volume/drivers/pure.py +++ b/cinder/volume/drivers/pure.py @@ -875,7 +875,6 @@ class PureISCSIDriver(PureBaseVolumeDriver, san.SanISCSIDriver): "driver_volume_type": "iscsi", "data": { "target_discovered": False, - "access_mode": "rw", "discard": True, }, } @@ -1030,7 +1029,6 @@ class PureFCDriver(PureBaseVolumeDriver, driver.FibreChannelDriver): 'target_discovered': True, "target_lun": connection["lun"], "target_wwn": target_wwns, - 'access_mode': 'rw', 'initiator_target_map': init_targ_map, "discard": True, } diff --git a/cinder/volume/drivers/tegile.py b/cinder/volume/drivers/tegile.py index 08a352a23..7dd928e0a 100644 --- a/cinder/volume/drivers/tegile.py +++ b/cinder/volume/drivers/tegile.py @@ -528,7 +528,6 @@ class TegileISCSIDriver(TegileIntelliFlashVolumeDriver, san.SanISCSIDriver): connection_data['target_lun'] = target_lun connection_data['target_discovered'] = False, connection_data['volume_id'] = volume['id'], - connection_data['access_mode'] = 'rw' connection_data['discard'] = False if getattr(self.configuration, 'use_chap_auth', False): connection_data['auth_method'] = 'CHAP' @@ -622,7 +621,6 @@ class TegileFCDriver(TegileIntelliFlashVolumeDriver, 'data': { 'encrypted': False, 'target_discovered': False, - 'access_mode': 'rw', 'target_lun': target_info['target_lun'], 'target_wwn': ast.literal_eval(target_info['target_wwn']), 'initiator_target_map': ast.literal_eval(initiator_target_map) diff --git a/cinder/volume/drivers/violin/v7000_fcp.py b/cinder/volume/drivers/violin/v7000_fcp.py index 4e57bbce4..9f12c10d8 100644 --- a/cinder/volume/drivers/violin/v7000_fcp.py +++ b/cinder/volume/drivers/violin/v7000_fcp.py @@ -152,7 +152,6 @@ class V7000FCPDriver(driver.FibreChannelDriver): properties['target_discovered'] = True properties['target_wwn'] = target_wwns properties['target_lun'] = lun_id - properties['access_mode'] = 'rw' properties['initiator_target_map'] = init_targ_map LOG.debug("Return FC data for zone addition: %(properties)s.", diff --git a/cinder/volume/drivers/xio.py b/cinder/volume/drivers/xio.py index d0b111ed1..6c6d9df2b 100644 --- a/cinder/volume/drivers/xio.py +++ b/cinder/volume/drivers/xio.py @@ -1345,7 +1345,6 @@ class XIOISEDriver(object): data = {} data['target_lun'] = target_lun data['volume_id'] = volume['id'] - data['access_mode'] = 'rw' return data def ise_unpresent(self, volume, endpoints): diff --git a/cinder/volume/manager.py b/cinder/volume/manager.py index 40b9c2bd3..c2a974e14 100644 --- a/cinder/volume/manager.py +++ b/cinder/volume/manager.py @@ -1399,14 +1399,13 @@ class VolumeManager(manager.SchedulerDependentManager): # Add access_mode to connection info volume_metadata = self.db.volume_admin_metadata_get(context.elevated(), volume_id) - if conn_info['data'].get('access_mode') is None: - access_mode = volume_metadata.get('attached_mode') - if access_mode is None: - # NOTE(zhiyan): client didn't call 'os-attach' before - access_mode = ('ro' - if volume_metadata.get('readonly') == 'True' - else 'rw') - conn_info['data']['access_mode'] = access_mode + access_mode = volume_metadata.get('attached_mode') + if access_mode is None: + # NOTE(zhiyan): client didn't call 'os-attach' before + access_mode = ('ro' + if volume_metadata.get('readonly') == 'True' + else 'rw') + conn_info['data']['access_mode'] = access_mode # Add encrypted flag to connection_info if not set in the driver. if conn_info['data'].get('encrypted') is None: diff --git a/cinder/volume/targets/iscsi.py b/cinder/volume/targets/iscsi.py index 497d76e87..e4917a9de 100644 --- a/cinder/volume/targets/iscsi.py +++ b/cinder/volume/targets/iscsi.py @@ -67,9 +67,6 @@ class ISCSITarget(driver.Target): present meaning no authentication, or auth_method == `CHAP` meaning use CHAP with the specified credentials. - :access_mode: the volume access mode allow client used - ('rw' or 'ro' currently supported) - :discard: boolean indicating if discard is supported In some of drivers that support multiple connections (for multipath @@ -282,7 +279,6 @@ class ISCSITarget(driver.Target): 'target_iqn': 'iqn.2010-10.org.openstack:volume-00000001', 'target_portal': '127.0.0.0.1:3260', 'volume_id': '9a0d35d0-175a-11e4-8c21-0800200c9a66', - 'access_mode': 'rw', 'discard': False, } } -- 2.45.2