diff options
author | Helen Walsh <helen.walsh@emc.com> | 2021-06-14 11:55:15 +0100 |
---|---|---|
committer | Helen Walsh <helen.walsh@emc.com> | 2021-09-22 09:30:02 +0100 |
commit | 5dcfe022440e6d6a61b4258b7b0eae1576e1209c (patch) | |
tree | e68d3cdd574eeab85a6d2473d7048f2d78dcb8de | |
parent | cf8e6be8aa763cc3ab505a3c4a7ab93b33ecb2c6 (diff) | |
download | cinder-5dcfe022440e6d6a61b4258b7b0eae1576e1209c.tar.gz |
PowerMax Driver - Allow for case mismatch in SGs
When checking if a storage group is a child of a parent storage
group the check is currently case sensitive. We should allow for
a pattern match that is not case sensitive. For example,
myStorageGroup should equal MYSTORAGEGROUP or mystoragegroup.
Closes-Bug: #1929429
Change-Id: I8dd114fedece8e9d8f85c1ed237c31aede907d67
(cherry picked from commit 1f65c2a92fe3931791fca81038a27f81e1ca28fd)
(cherry picked from commit 80ef8c1046c1c786f2e8f04352f9ce7c8f9af588)
5 files changed, 30 insertions, 3 deletions
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 32e27a7e0..d70619acc 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/fc.py b/cinder/volume/drivers/dell_emc/powermax/fc.py index 28b35ed80..7b35aac5a 100644 --- a/cinder/volume/drivers/dell_emc/powermax/fc.py +++ b/cinder/volume/drivers/dell_emc/powermax/fc.py @@ -131,9 +131,10 @@ class PowerMaxFCDriver(san.SanDriver, driver.FibreChannelDriver): - Support for Failover Abilities (bp/powermax-failover-abilities) 4.3.1 - Fix non-temporary snapshot delete (#1887962) 4.3.2 - Fix for create snapshot (#1939139) + 4.3.3 - Allow for case mismatch in SGs (bug #1929429) """ - VERSION = "4.3.2" + VERSION = "4.3.3" # ThirdPartySystems wiki CI_WIKI_NAME = "EMC_VMAX_CI" diff --git a/cinder/volume/drivers/dell_emc/powermax/iscsi.py b/cinder/volume/drivers/dell_emc/powermax/iscsi.py index c90288681..ac20d561b 100644 --- a/cinder/volume/drivers/dell_emc/powermax/iscsi.py +++ b/cinder/volume/drivers/dell_emc/powermax/iscsi.py @@ -137,9 +137,10 @@ class PowerMaxISCSIDriver(san.SanISCSIDriver): - Support for Failover Abilities (bp/powermax-failover-abilities) 4.3.1 - Fix non-temporary snapshot delete (#1887962) 4.3.2 - Fix for create snapshot (#1939139) + 4.3.3 - Allow for case mismatch in SGs (bug #1929429) """ - VERSION = "4.3.2" + VERSION = "4.3.3" # ThirdPartySystems wiki CI_WIKI_NAME = "EMC_VMAX_CI" diff --git a/cinder/volume/drivers/dell_emc/powermax/rest.py b/cinder/volume/drivers/dell_emc/powermax/rest.py index df3c30a51..e4558c244 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 000000000..d7a7e3d6e --- /dev/null +++ b/releasenotes/notes/bug1929429-e749f5e5a242a599.yaml @@ -0,0 +1,8 @@ +--- +fixes: + - | + PowerMax driver `bug #1929429 + <https://bugs.launchpad.net/cinder/+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. |