Browse Source

Merge "NEC driver: fix an undefined variable" into stable/queens

changes/10/733110/1
Zuul 1 month ago
committed by Gerrit Code Review
parent
commit
e7506bb535
2 changed files with 8 additions and 2 deletions
  1. +7
    -0
      cinder/tests/unit/volume/drivers/nec/test_volume.py
  2. +1
    -2
      cinder/volume/drivers/nec/volume_helper.py

+ 7
- 0
cinder/tests/unit/volume/drivers/nec/test_volume.py View File

@@ -671,6 +671,13 @@ class BindLDTest(volume_helper.MStorageDSVDriver, test.TestCase):
self.vol, self.vol.size, None,
self._convert_id2name,
self._select_leastused_poolnumber)
self.mock_object(self._cli, 'get_pair_lds',
return_value={'lds1', 'lds2', 'lds3'})
with self.assertRaisesRegex(exception.VolumeBackendAPIException,
'Cannot create clone volume. '
'number of pairs reached 3. '
'ldname=LX:287RbQoP7VdwR1WsPC2fZT'):
self.create_cloned_volume(self.vol, self.src)

def test_bindld_CreateCloneWaitingInterval(self):
self.assertEqual(10, cli.get_sleep_time_for_clone(0))


+ 1
- 2
cinder/volume/drivers/nec/volume_helper.py View File

@@ -476,8 +476,7 @@ class MStorageDriver(volume_common.MStorageVolumeCommon):
if len(pair_lds) == 3:
msg = (_('Cannot create clone volume. '
'number of pairs reached 3. '
'%(msg)s. ldname=%(ldname)s') %
{'msg': msg, 'ldname': source_name})
'ldname=%s') % source_name)
LOG.error(msg)
raise exception.VolumeBackendAPIException(data=msg)



Loading…
Cancel
Save