'_get_mapdata for FibreChannel.'

def _get_mapdata_fc(self, aglist, vol_instance, target_portlist):

    target_wwn = []
    try:
        ag_volmaplist = self._reference_eternus_names(aglist[0], ResultClass='CIM_ProtocolControllerForUnit')
        vo_volmaplist = self._reference_eternus_names(vol_instance.path, ResultClass='CIM_ProtocolControllerForUnit')
    except pywbem.CIM_Error:
        msg = (_('_get_mapdata_fc,    getting    host-affinity    from    aglist/vol_instance    failed,    affinitygroup:    %(ag)s,    ReferenceNames,    cannot    connect    to    ETERNUS.') % {'ag': aglist[0]})
        LOG.exception(msg)
        raise exception.VolumeBackendAPIException(data=msg)
    volmap = None
    for vo_volmap in vo_volmaplist:
        if (vo_volmap in ag_volmaplist):
            volmap = vo_volmap
            break
    try:
        volmapinstance = self._get_eternus_instance(volmap, LocalOnly=False)
    except pywbem.CIM_Error:
        msg = (_('_get_mapdata_fc,    getting    host-affinity    instance    failed,    volmap:    %(volmap)s,    GetInstance,    cannot    connect    to    ETERNUS.') % {'volmap': volmap})
        LOG.exception(msg)
        raise exception.VolumeBackendAPIException(data=msg)
    target_lun = int(volmapinstance['DeviceNumber'], 16)
    for target_port in target_portlist:
        target_wwn.append(target_port['Name'])
    mapdata = {'target_wwn': target_wwn, 'target_lun': target_lun}
    LOG.debug('_get_mapdata_fc,    mapdata:    %s.', mapdata)
    return mapdata
