VMAX driver - Fix AttributeError of dell emc driver

initiator_check is defined as a type of bool,
but is used as a str type.

Change-Id: Ib01deaa222c2ee2d16256bf2e8540af782f5dbf8
Closes-Bug: #1736661
This commit is contained in:
wanghongxu 2017-12-06 15:42:08 +08:00 committed by Helen Walsh
parent 6c99154836
commit 615530e7b0
2 changed files with 11 additions and 7 deletions

View File

@ -5010,6 +5010,16 @@ class VMAXCommonTest(test.TestCase):
mock_revert.assert_called_once_with(
array, device_id, snap_name, extra_specs)
def test_get_initiator_check_flag(self):
self.common.configuration.initiator_check = False
initiator_check = self.common._get_initiator_check_flag()
self.assertFalse(initiator_check)
def test_get_initiator_check_flag_true(self):
self.common.configuration.initiator_check = True
initiator_check = self.common._get_initiator_check_flag()
self.assertTrue(initiator_check)
class VMAXFCTest(test.TestCase):
def setUp(self):

View File

@ -164,13 +164,7 @@ class VMAXCommon(object):
:returns: flag
"""
conf_string = (self.configuration.safe_get('initiator_check'))
ret_val = False
string_true = "True"
if conf_string:
if conf_string.lower() == string_true.lower():
ret_val = True
return ret_val
return self.configuration.safe_get('initiator_check')
def _get_replication_info(self):
"""Gather replication information, if provided."""