'Get the ports WWN of FC on array.
:param host: the host to which the FC port is registered.
:param logged_in_only: whether to retrieve only the logged-in port.
:return: the WWN of FC ports. For example, the FC WWN on array is like:
50:06:01:60:89:20:09:25:50:06:01:6C:09:20:09:25.
This function removes the colons and returns the last 16 bits:
5006016C09200925.'

def get_fc_target_info(self, host=None, logged_in_only=False, allowed_ports=None):

    wwns = set()
    if logged_in_only:
        for paths in filter(None, host.fc_host_initiators.paths):
            paths = paths.shadow_copy(is_logged_in=True)
            wwns.update((p.wwn.upper() for p in filter((lambda fcp: ((allowed_ports is None) or (fcp.get_id() in allowed_ports))), paths.fc_port)))
    else:
        ports = self.get_fc_ports()
        ports = ports.shadow_copy(port_ids=allowed_ports)
        wwns.update((p.wwn.upper() for p in ports))
    return [wwn.replace(':', '')[16:] for wwn in wwns]
