Merge "PowerMax Driver - Exception when multipath not enabled for metro"

This commit is contained in:
Zuul 2020-09-22 20:53:06 +00:00 committed by Gerrit Code Review
commit 0fed431e9c
2 changed files with 12 additions and 9 deletions

View File

@ -194,9 +194,9 @@ class PowerMaxReplicationTest(test.TestCase):
@mock.patch.object(utils.PowerMaxUtils, 'is_metro_device',
return_value=True)
def test_initialize_connection_no_multipath_iscsi(self, mock_md):
info_dict = self.iscsi_common.initialize_connection(
self.data.test_volume, self.data.connector)
self.assertIsNone(info_dict)
self.assertRaises(exception.VolumeBackendAPIException,
self.iscsi_common.initialize_connection,
self.data.test_volume, self.data.connector)
@mock.patch.object(
masking.PowerMaxMasking, 'pre_multiattach',

View File

@ -918,12 +918,15 @@ class PowerMaxCommon(object):
remote_port_group = None
if (self.utils.is_metro_device(rep_config, extra_specs)
and not is_multipath and self.protocol.lower() == 'iscsi'):
LOG.warning("Either multipathing is not correctly/currently "
"enabled on your system or the volume was created "
"prior to multipathing being enabled. Please refer "
"to the online PowerMax Cinder driver documentation "
"for this release for further details.")
return
exception_message = _(
"Either multipathing is not correctly/currently "
"enabled on your system or the volume was created "
"prior to multipathing being enabled. Please refer "
"to the online PowerMax Cinder driver documentation "
"for this release for further details.")
LOG.error(exception_message)
raise exception.VolumeBackendAPIException(
message=exception_message)
if self.utils.is_volume_failed_over(volume):
extra_specs = rep_extra_specs