Dell Unity: Fix driver startup issue with LACP configured

For Unity 5.x, port property `parent_storage_processor` is
deprecated. Read port property `storage_processor` instead.

Closes-Bug: #2020745
Change-Id: I085dbf2ad8eaaa7f1d43d5f0cb42fad5e18eca3d
Signed-off-by: Yian Zong <yian.zong@dell.com>
This commit is contained in:
Yian Zong
2025-07-04 08:30:31 +00:00
parent 48cc585dbe
commit be441c9879
4 changed files with 36 additions and 2 deletions

View File

@@ -44,9 +44,10 @@ from manila import utils
8.0.0 - Supports manage/unmanage share server/share/snapshot
9.0.0 - Implements default filter function
9.0.1 - Bugfix: remove enable ace process when creating cifs share
9.0.2 - Bugfix: fix the driver startup issue with LACP ports configured
"""
VERSION = "9.0.1"
VERSION = "9.0.2"
LOG = log.getLogger(__name__)
SUPPORTED_NETWORK_TYPES = (None, 'flat', 'vlan')

View File

@@ -61,7 +61,12 @@ def match_ports(ports_list, port_ids_conf):
port_id = port.get_id()
for pattern in patterns:
if fnmatch.fnmatchcase(port_id, pattern):
sp_id = port.parent_storage_processor.get_id()
# parentStorageProcessor property is deprecated in Unity 5.x
if port.parent_storage_processor:
sp = port.parent_storage_processor
else:
sp = port.storage_processor
sp_id = sp.get_id()
ports_set = sp_ports_map.setdefault(sp_id, set())
ports_set.add(port_id)
break

View File

@@ -54,6 +54,24 @@ SPA_LA1 = MockPort(SPA, 'spa_la_1', 1500)
SPB_LA1 = MockPort(SPB, 'spb_la_1', 1500)
class MockPortV5(object):
def __init__(self, sp, port_id, mtu):
self._sp = sp
self.port_id = port_id
self.mtu = mtu
def get_id(self):
return self.port_id
@property
def storage_processor(self):
return self._sp
SPA_LA2 = MockPort(SPA, 'spa_la_2', 1500)
SPB_LA2 = MockPort(SPB, 'spb_la_2', 1500)
@ddt.ddt
class TestUtils(test.TestCase):
@ddt.data({'matcher': None,
@@ -96,6 +114,10 @@ class TestUtils(test.TestCase):
'ids_conf': ['spa*'],
'port_map': {'spa': {'spa_eth0', 'spa_eth1'}},
'unmanaged': {'spb_eth0'}},
{'ports': [SPA_LA2, SPB_LA2],
'ids_conf': None,
'port_map': {'spa': {'spa_la_2'}, 'spb': {'spb_la_2'}},
'unmanaged': set()},
)
@ddt.unpack
def test_match_ports(self, ports, ids_conf, port_map, unmanaged):

View File

@@ -0,0 +1,6 @@
---
fixes:
- |
Dell Unity Driver `Bug #2020745
<https://bugs.launchpad.net/manila/+bug/2020745>`_:
Fixed driver startup issue with link aggregation configured.