diff --git a/cinder/tests/unit/volume/drivers/dell_emc/powermax/test_powermax_rest.py b/cinder/tests/unit/volume/drivers/dell_emc/powermax/test_powermax_rest.py index 23101c80f92..d62ca56cdcd 100644 --- a/cinder/tests/unit/volume/drivers/dell_emc/powermax/test_powermax_rest.py +++ b/cinder/tests/unit/volume/drivers/dell_emc/powermax/test_powermax_rest.py @@ -628,6 +628,22 @@ class PowerMaxRestTest(test.TestCase): self.assertTrue(is_child1) self.assertFalse(is_child2) + def test_is_child_sg_in_parent_sg_case_not_matching(self): + lower_case_host = 'OS-hostx-SRP_1-DiamondDSS-os-fibre-PG' + + is_child1 = self.rest.is_child_sg_in_parent_sg( + self.data.array, lower_case_host, + self.data.parent_sg_f) + self.assertTrue(is_child1) + + def test_is_child_sg_in_parent_sg_spelling_mistake(self): + lower_case_host = 'OS-hosty-SRP_1-DiamondDSS-os-fiber-PG' + + is_child1 = self.rest.is_child_sg_in_parent_sg( + self.data.array, lower_case_host, + self.data.parent_sg_f) + self.assertFalse(is_child1) + def test_add_child_sg_to_parent_sg(self): payload = {'editStorageGroupActionParam': { 'expandStorageGroupParam': { diff --git a/cinder/volume/drivers/dell_emc/powermax/rest.py b/cinder/volume/drivers/dell_emc/powermax/rest.py index 26692b59e2a..6837f9f1610 100644 --- a/cinder/volume/drivers/dell_emc/powermax/rest.py +++ b/cinder/volume/drivers/dell_emc/powermax/rest.py @@ -925,7 +925,8 @@ class PowerMaxRest(object): parent_sg = self.get_storage_group(array, parent_name) if parent_sg and parent_sg.get('child_storage_group'): child_sg_list = parent_sg['child_storage_group'] - if child_name in child_sg_list: + if child_name.lower() in ( + child.lower() for child in child_sg_list): return True return False diff --git a/releasenotes/notes/bug1929429-e749f5e5a242a599.yaml b/releasenotes/notes/bug1929429-e749f5e5a242a599.yaml new file mode 100644 index 00000000000..d7a7e3d6e5e --- /dev/null +++ b/releasenotes/notes/bug1929429-e749f5e5a242a599.yaml @@ -0,0 +1,8 @@ +--- +fixes: + - | + PowerMax driver `bug #1929429 + `_: Fixes + child/parent storage group check so that a pattern match + is not case sensitive. For example, myStorageGroup should + equal MYSTORAGEGROUP and mystoragegroup.