def _get_one_fc_port_for_zone(self, initiator, contr, nsinfos, cfgmap_from_fabrics, fabric_maps):
    'Get on FC port per one controller.\n\n        task flow:\n        1. Get all the FC port from the array.\n        2. Filter out ports belonged to the specific controller\n           and the status is connected.\n        3. Filter out ports connected to the fabric configured in cinder.conf.\n        4. Get active zones set from switch.\n        5. Find a port according to three cases.\n        '
    LOG.info(_LI('Get in function _get_one_fc_port_for_zone. Initiator: %s'), initiator)
    formatted_initiator = fczm_utils.get_formatted_wwn(initiator)
    fabric_map = fabric_maps[contr]
    if (not fabric_map):
        return (None, False)
    port_zone_number_map = {}
    for fabric in fabric_map:
        LOG.info(_LI('Dealing with fabric: %s'), fabric)
        nsinfo = nsinfos[fabric]
        if (formatted_initiator not in nsinfo):
            continue
        final_port_list_per_fabric = fabric_map[fabric]
        cfgmap_from_fabric = cfgmap_from_fabrics[fabric]
        zones_members = cfgmap_from_fabric['zones'].values()
        for port in final_port_list_per_fabric:
            port_zone_number_map[port] = 0
            formatted_port = fczm_utils.get_formatted_wwn(port)
            for zones_member in zones_members:
                if (formatted_port in zones_member):
                    if (formatted_initiator in zones_member):
                        return (port, False)
                    port_zone_number_map[port] += 1
    if (port_zone_number_map == {}):
        return (None, False)
    temp_list = []
    temp_list = sorted(port_zone_number_map.items(), key=(lambda d: d[1]))
    return (temp_list[0][0], True)
Get on FC port per one controller.

task flow:
1. Get all the FC port from the array.
2. Filter out ports belonged to the specific controller
   and the status is connected.
3. Filter out ports connected to the fabric configured in cinder.conf.
4. Get active zones set from switch.
5. Find a port according to three cases.
def _get_one_fc_port_for_zone(self, initiator, contr, nsinfos, cfgmap_from_fabrics, fabric_maps):
    'Get on FC port per one controller.\n\n        task flow:\n        1. Get all the FC port from the array.\n        2. Filter out ports belonged to the specific controller\n           and the status is connected.\n        3. Filter out ports connected to the fabric configured in cinder.conf.\n        4. Get active zones set from switch.\n        5. Find a port according to three cases.\n        '
    LOG.info(_LI('Get in function _get_one_fc_port_for_zone. Initiator: %s'), initiator)
    formatted_initiator = fczm_utils.get_formatted_wwn(initiator)
    fabric_map = fabric_maps[contr]
    if (not fabric_map):
        return (None, False)
    port_zone_number_map = {}
    for fabric in fabric_map:
        LOG.info(_LI('Dealing with fabric: %s'), fabric)
        nsinfo = nsinfos[fabric]
        if (formatted_initiator not in nsinfo):
            continue
        final_port_list_per_fabric = fabric_map[fabric]
        cfgmap_from_fabric = cfgmap_from_fabrics[fabric]
        zones_members = cfgmap_from_fabric['zones'].values()
        for port in final_port_list_per_fabric:
            port_zone_number_map[port] = 0
            formatted_port = fczm_utils.get_formatted_wwn(port)
            for zones_member in zones_members:
                if (formatted_port in zones_member):
                    if (formatted_initiator in zones_member):
                        return (port, False)
                    port_zone_number_map[port] += 1
    if (port_zone_number_map == {}):
        return (None, False)
    temp_list = []
    temp_list = sorted(port_zone_number_map.items(), key=(lambda d: d[1]))
    return (temp_list[0][0], True)