]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commitdiff
Remove access_mode 'rw' setting in drivers
authorNate Potter <nathaniel.potter@intel.com>
Fri, 8 Jan 2016 20:52:02 +0000 (20:52 +0000)
committerNate Potter <nathaniel.potter@intel.com>
Fri, 22 Jan 2016 16:47:02 +0000 (16:47 +0000)
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

21 files changed:
cinder/tests/unit/test_dellscapi.py
cinder/tests/unit/test_infortrend_cli.py
cinder/tests/unit/test_pure.py
cinder/tests/unit/test_tegile.py
cinder/tests/unit/test_xio.py
cinder/volume/driver.py
cinder/volume/drivers/dell/dell_storagecenter_api.py
cinder/volume/drivers/dell/dell_storagecenter_iscsi.py
cinder/volume/drivers/emc/emc_cli_fc.py
cinder/volume/drivers/emc/emc_cli_iscsi.py
cinder/volume/drivers/emc/xtremio.py
cinder/volume/drivers/infortrend/eonstor_ds_cli/common_cli.py
cinder/volume/drivers/infortrend/infortrend_fc_cli.py
cinder/volume/drivers/infortrend/infortrend_iscsi_cli.py
cinder/volume/drivers/prophetstor/dpl_iscsi.py
cinder/volume/drivers/pure.py
cinder/volume/drivers/tegile.py
cinder/volume/drivers/violin/v7000_fcp.py
cinder/volume/drivers/xio.py
cinder/volume/manager.py
cinder/volume/targets/iscsi.py

index 50977836df3602c3e2e4de20e29e9bbfa3db276a..ebb3d5dd75a2827766c49be67b0dd50232596d5c 100644 (file)
@@ -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':
index 0e7614773276ee8edb7fea92a15d2557ec2ea321..3534385eb7ad1830abb072a369fb401cbbd578f7 100644 (file)
@@ -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,
         },
     }
index f4eb7956ec61c032c94b575aaaef62e5e69d7682..4e8de97e97bc36ba0bb5095c9cccf79d71cbf8bf 100644 (file)
@@ -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,
     },
index 1f1a198ddb2e8ab15c67e00876348a75fb2037ac..82c483246230ff8d4e1b8fce8bff4c6fa93246f4 100644 (file)
@@ -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'],
index 9c922821fba2de666f413970e4a61ecaf1d14a1a..e7f5d2bb4eb98c5f57e389b528a18fb9054ba8ba 100644 (file)
@@ -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}}
index dc579eed10f5697a6e31d34e288cf75c1760933c..964048f06ff6baef1f57c79e3f86ccefc94419f9 100644 (file)
@@ -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,
                 }
             }
index 47b85ddcb20b52d45c9f7a5beb1b171764687fdc..8ace33659401aba9b9802f869683967c8875bfb0 100644 (file)
@@ -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)
index 0da98c9a6a7f2bfe4a7b5724496074d916ead5e1..27f5fc8ae14d098ba204926a7b3642c2321dad16 100644 (file)
@@ -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
index 37737b51c0092904fca0426a47f52660ab53b780..db919bb5d93d7c59f8be4c9e4487163381cd2d53 100644 (file)
@@ -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']
index eb6bc221b0b2facdff74b3bf7aa923b12a1f81d6..5b0ff9214b54b578930fbc1ccaa985c188026bfb 100644 (file)
@@ -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'
                 }
             }
 
index 362ca3dae045ca2211b354a56c4866891dcffafe..707c238997728f9b6dce27176709cd2d56be3fc8 100644 (file)
@@ -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
index 42fc3f68910ee049a7dd17472e49f90c25028d9f..a38f863de3abeca9af59cb9f6a3def58c855ef67 100644 (file)
@@ -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,
             },
         }
index c783ad03c51e7ef16ec6ebb0167de25bc58365b4..23766a21e27773e0c10ca1a832b732ed10950862 100644 (file)
@@ -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']
index 3430047e5e9f16ede9853ebdc38e2c9c2b1b6baf..cc380bb847bc2e5852be48aae0372b35ff89b0e1 100644 (file)
@@ -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'
                 }
             }
         """
index 157fa3f6bfa918f5596394f988ce957fc8a07321..ed6eb50618743e82a6142e41a471b20e39186245 100644 (file)
@@ -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
index f32916ce3643d0c799e8675f382c97cbab3389c3..e5e121902020dc522e90de8f61eac2fa1e68428b 100644 (file)
@@ -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,
             }
index 08a352a2333416d39a260082a9e19b9f5be600b2..7dd928e0a7f8da14b455d0b79878c8719a365b71 100644 (file)
@@ -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)
index 4e57bbce41dc523d28ccd2d6461e4f1392f5e0ad..9f12c10d83fe38a5bcb0861802a13625d0bb141b 100644 (file)
@@ -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.",
index d0b111ed1ebaf8e404ab6f663ee8e4be6d725dd0..6c6d9df2b5366b5a375831cea53a34666978c794 100644 (file)
@@ -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):
index 40b9c2bd3b7e05eb71bbffbfb1ad2447efe45f49..c2a974e141ed62e7d7db1d224aac47f9d3baba99 100644 (file)
@@ -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:
index 497d76e870cfa0421b01b9b60c4bf0e31589180e..e4917a9de57a264d7613516b88c20ef2ecf326ae 100644 (file)
@@ -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,
                 }
             }