Merge "NEC driver: Return non-random iscsi portal in initialize"
This commit is contained in:
commit
9e3e201739
@ -769,6 +769,7 @@ class ExportTest(volume_helper.MStorageDSVDriver, test.TestCase):
|
||||
self.assertEqual('iscsi', info['driver_volume_type'])
|
||||
self.assertEqual('iqn.2010-10.org.openstack:volume-00000001',
|
||||
info['data']['target_iqn'])
|
||||
self.assertEqual('1.1.1.1:3260', info['data']['target_portal'])
|
||||
self.assertEqual(88, info['data']['target_lun'])
|
||||
self.assertEqual('iqn.2010-10.org.openstack:volume-00000001',
|
||||
info['data']['target_iqns'][0])
|
||||
|
@ -14,7 +14,6 @@
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
import random
|
||||
import re
|
||||
import traceback
|
||||
|
||||
@ -289,8 +288,8 @@ class MStorageDriver(volume_common.MStorageVolumeCommon):
|
||||
break
|
||||
if (self._properties['portal_number'] > 0 and
|
||||
len(dirportal) > self._properties['portal_number']):
|
||||
nominated.extend(random.sample(
|
||||
dirportal, self._properties['portal_number']))
|
||||
nominated.extend(
|
||||
dirportal[0:self._properties['portal_number']])
|
||||
else:
|
||||
nominated.extend(dirportal)
|
||||
|
||||
@ -1096,8 +1095,8 @@ class MStorageDriver(volume_common.MStorageVolumeCommon):
|
||||
provider_location = volume.provider_location
|
||||
provider_location = provider_location.split()
|
||||
info = {'driver_volume_type': 'iscsi',
|
||||
'data': {'target_portal': random.choice(
|
||||
provider_location[0][0:-2].split(";")),
|
||||
'data': {'target_portal':
|
||||
provider_location[0][0:-2].split(";")[0],
|
||||
'target_iqn': provider_location[1],
|
||||
'target_lun': int(provider_location[2]),
|
||||
'target_discovered': False,
|
||||
|
Loading…
Reference in New Issue
Block a user