Fix BrcdFCSANlookupService to iterate multiple switches.
Changed close_connection to client.close_connection. Fixed return map to key on fabric name instead of principal switch wwn. Closes-Bug: 1303460 Change-Id: I3725c16cd416a028b85ac8ac6c0d895fd6900763
This commit is contained in:
parent
9cc1422bfb
commit
0f7dba831d
|
@ -39,7 +39,7 @@ switch_data = [' N 011a00;2,3;20:1a:00:05:1e:e8:e3:29;\
|
|||
20:1a:00:05:1e:e8:e3:29;na']
|
||||
nsshow_data = ['10:00:8c:7c:ff:52:3b:01', '20:24:00:02:ac:00:0a:50']
|
||||
_device_map_to_verify = {
|
||||
'100000051e55a100': {
|
||||
'BRCD_FAB_2': {
|
||||
'initiator_port_wwn_list': ['10008c7cff523b01'],
|
||||
'target_port_wwn_list': ['20240002ac000a50']}}
|
||||
|
||||
|
|
|
@ -124,9 +124,6 @@ class BrcdFCSanLookupService(FCSanLookupService):
|
|||
'fc_fabric_password')
|
||||
fabric_port = self.fabric_configs[fabric_name].safe_get(
|
||||
'fc_fabric_port')
|
||||
fabric_principal_wwn = \
|
||||
self.fabric_configs[fabric_name].safe_get(
|
||||
'principal_switch_wwn')
|
||||
|
||||
# Get name server data from fabric and find the targets
|
||||
# logged in
|
||||
|
@ -148,7 +145,7 @@ class BrcdFCSanLookupService(FCSanLookupService):
|
|||
LOG.error(msg)
|
||||
raise exception.FCSanLookupServiceException(message=msg)
|
||||
finally:
|
||||
self.close_connection()
|
||||
self.client.close()
|
||||
LOG.debug("Lookup service:nsinfo-%s", nsinfo)
|
||||
LOG.debug("Lookup service:initiator list from "
|
||||
"caller-%s", formatted_initiator_list)
|
||||
|
@ -182,7 +179,7 @@ class BrcdFCSanLookupService(FCSanLookupService):
|
|||
'initiator_port_wwn_list': visible_initiators,
|
||||
'target_port_wwn_list': visible_targets
|
||||
}
|
||||
device_map[fabric_principal_wwn] = fabric_map
|
||||
device_map[fabric_name] = fabric_map
|
||||
LOG.debug("Device map for SAN context: %s", device_map)
|
||||
return device_map
|
||||
|
||||
|
@ -211,11 +208,6 @@ class BrcdFCSanLookupService(FCSanLookupService):
|
|||
LOG.debug("Connector returning nsinfo-%s", nsinfo_list)
|
||||
return nsinfo_list
|
||||
|
||||
def close_connection(self):
|
||||
"""This will close the client connection."""
|
||||
self.client.close()
|
||||
self.client = None
|
||||
|
||||
def _get_switch_data(self, cmd):
|
||||
stdin, stdout, stderr = None, None, None
|
||||
utils.check_ssh_injection([cmd])
|
||||
|
|
Loading…
Reference in New Issue