'Lookup SAN context for visible end devices.
Look up each SAN configured and return a map of SAN (fabric IP) to
list of target WWNs visible to the fabric.'

def get_san_context(self, target_wwn_list):

    formatted_target_list = []
    fabric_map = {}
    fabrics = [x.strip() for x in self.configuration.fc_fabric_names.split(',')]
    LOG.debug('Fabric    List:    %s', fabrics)
    LOG.debug('Target    wwn    List:    %s', target_wwn_list)
    if (len(fabrics) > 0):
        for t in target_wwn_list:
            formatted_target_list.append(zm_utils.get_formatted_wwn(t.lower()))
        LOG.debug('Formatted    Target    wwn    List:    %s', formatted_target_list)
        for fabric_name in fabrics:
            fabric_ip = self.fabric_configs[fabric_name].safe_get('cisco_fc_fabric_address')
            fabric_user = self.fabric_configs[fabric_name].safe_get('cisco_fc_fabric_user')
            fabric_pwd = self.fabric_configs[fabric_name].safe_get('cisco_fc_fabric_password')
            fabric_port = self.fabric_configs[fabric_name].safe_get('cisco_fc_fabric_port')
            zoning_vsan = self.fabric_configs[fabric_name].safe_get('cisco_zoning_vsan')
            nsinfo = None
            try:
                conn = importutils.import_object(self.configuration.cisco_sb_connector, ipaddress=fabric_ip, username=fabric_user, password=fabric_pwd, port=fabric_port, vsan=zoning_vsan)
                nsinfo = conn.get_nameserver_info()
                LOG.debug('show    fcns    database    info    from    fabric:    %s', nsinfo)
                conn.cleanup()
            except exception.CiscoZoningCliException:
                with excutils.save_and_reraise_exception():
                    LOG.exception('Error    getting    show    fcns    database    info.')
            except Exception:
                msg = _('Failed    to    get    show    fcns    database    info.')
                LOG.exception(msg)
                raise exception.FCZoneDriverException(msg)
            visible_targets = filter((lambda x: (x in formatted_target_list)), nsinfo)
            if visible_targets:
                LOG.info('Filtered    targets    for    SAN    is:    %s', {fabric_name: visible_targets})
                for (idx, elem) in enumerate(visible_targets):
                    visible_targets[idx] = six.text_type(visible_targets[idx]).replace(':', '')
                fabric_map[fabric_name] = visible_targets
            else:
                LOG.debug('No    targets    are    in    the    fcns    info    for    SAN    %s', fabric_name)
    LOG.debug('Return    SAN    context    output:    %s', fabric_map)
    return fabric_map
