Browse Source

Merge "Brocade: Fix lookup UnboundLocalError"

changes/67/746267/1
Zuul 1 year ago
committed by Gerrit Code Review
parent
commit
fff95fa6a6
  1. 10
      cinder/tests/unit/zonemanager/test_brcd_fc_san_lookup_service.py
  2. 1
      cinder/zonemanager/drivers/brocade/brcd_fc_san_lookup_service.py
  3. 5
      releasenotes/notes/brocade_looup_fail_get_client-179151d449a34aa4.yaml

10
cinder/tests/unit/zonemanager/test_brcd_fc_san_lookup_service.py

@ -124,6 +124,16 @@ class TestBrcdFCSanLookupService(brcd_lookup.BrcdFCSanLookupService,
initiator_list, target_list)
self.assertDictEqual(_device_map_to_verify, device_map)
@mock.patch.object(brcd_lookup.BrcdFCSanLookupService,
'_get_southbound_client', side_effect=ValueError)
def test_get_device_mapping_from_network_fail(self,
get_southbound_client_mock):
initiator_list = [parsed_switch_port_wwns[1]]
target_list = [parsed_switch_port_wwns[0], '20240002ac000a40']
self.assertRaises(brcd_lookup.exception.FCSanLookupServiceException,
self.get_device_mapping_from_network,
initiator_list, target_list)
class FakeClient(object):
def is_supported_firmware(self):

1
cinder/zonemanager/drivers/brocade/brcd_fc_san_lookup_service.py

@ -111,6 +111,7 @@ class BrcdFCSanLookupService(fc_service.FCSanLookupService):
# Get name server data from fabric and find the targets
# logged in
nsinfo = ''
conn = None
try:
LOG.debug("Getting name server data for "
"fabric %s", fabric_ip)

5
releasenotes/notes/brocade_looup_fail_get_client-179151d449a34aa4.yaml

@ -0,0 +1,5 @@
---
fixes:
- |
Fix `UnboundLocalError` on the Brocade lookup driver on southbound client
creation failure during the device mapping retrieval (Bug #1888550).
Loading…
Cancel
Save