'Provides the initiator/target map for available SAN contexts.
Looks up nameserver of each fc SAN configured to find logged in devices
and returns a map of initiator and target port WWNs for each fabric.
:param initiator_wwn_list: List of initiator port WWN
:param target_wwn_list: List of target port WWN
:returns: List -- device wwn map in following format
.. code-block:: default
<San name>: {
\'initiator_port_wwn_list\':
(\'200000051e55a100\', \'200000051e55a121\'..)
\'target_port_wwn_list\':
(\'100000051e55a100\', \'100000051e55a121\'..)
:raises Exception: when connection to fabric is failed'

def get_device_mapping_from_network(self, initiator_wwn_list, target_wwn_list):

    device_map = {}
    formatted_target_list = []
    formatted_initiator_list = []
    fabric_map = {}
    fabric_names = self.configuration.fc_fabric_names
    fabrics = None
    if (not fabric_names):
        raise exception.InvalidParameterValue(err=_('Missing    Fibre    Channel    SAN    configuration    param    -    fc_fabric_names'))
    fabrics = [x.strip() for x in fabric_names.split(',')]
    LOG.debug('FC    Fabric    List:    %s', fabrics)
    if fabrics:
        for t in target_wwn_list:
            formatted_target_list.append(fczm_utils.get_formatted_wwn(t))
        for i in initiator_wwn_list:
            formatted_initiator_list.append(fczm_utils.get_formatted_wwn(i))
        for fabric_name in fabrics:
            fabric_ip = self.fabric_configs[fabric_name].safe_get('fc_fabric_address')
            nsinfo = ''
            try:
                LOG.debug('Getting    name    server    data    for    fabric    %s', fabric_ip)
                conn = self._get_southbound_client(fabric_name)
                nsinfo = conn.get_nameserver_info()
            except exception.FCSanLookupServiceException:
                with excutils.save_and_reraise_exception():
                    LOG.error('Failed    collecting    name    server    info    from    fabric    %s', fabric_ip)
            except Exception as e:
                msg = (_('SSH    connection    failed    for    %(fabric)s    with    error:    %(err)s') % {'fabric': fabric_ip, 'err': e})
                LOG.error(msg)
                raise exception.FCSanLookupServiceException(message=msg)
            LOG.debug('Lookup    service:nsinfo-%s', nsinfo)
            LOG.debug('Lookup    service:initiator    list    from    caller-%s', formatted_initiator_list)
            LOG.debug('Lookup    service:target    list    from    caller-%s', formatted_target_list)
            visible_targets = [x for x in nsinfo if (x in formatted_target_list)]
            visible_initiators = [x for x in nsinfo if (x in formatted_initiator_list)]
            if visible_targets:
                LOG.debug('Filtered    targets    is:    %s', visible_targets)
                for (idx, elem) in enumerate(visible_targets):
                    elem = str(elem).replace(':', '')
                    visible_targets[idx] = elem
            else:
                LOG.debug('No    targets    are    in    the    nameserver    for    SAN    %s', fabric_name)
            if visible_initiators:
                for (idx, elem) in enumerate(visible_initiators):
                    elem = str(elem).replace(':', '')
                    visible_initiators[idx] = elem
            else:
                LOG.debug('No    initiators    are    in    the    nameserver    for    SAN    %s', fabric_name)
            fabric_map = {'initiator_port_wwn_list': visible_initiators, 'target_port_wwn_list': visible_targets}
            device_map[fabric_name] = fabric_map
    LOG.debug('Device    map    for    SAN    context:    %s', device_map)
    return device_map
