def _check_fc_port_and_init(self, wwns, hostid, fabric_map, nsinfos):
    'Check FC port on array and wwn on host is connected to switch.\n\n        If no FC port on array is connected to switch or no ini on host is\n        connected to switch, raise a error.\n        '
    if (not fabric_map):
        msg = _('No FC port on array is connected to switch.')
        LOG.error(msg)
        raise exception.CinderException(msg)
    no_wwn_connected_to_switch = True
    for wwn in wwns:
        formatted_initiator = fczm_utils.get_formatted_wwn(wwn)
        for fabric in fabric_map:
            nsinfo = nsinfos[fabric]
            if (formatted_initiator in nsinfo):
                no_wwn_connected_to_switch = False
                self.client.ensure_fc_initiator_added(wwn, hostid)
                break
    if no_wwn_connected_to_switch:
        msg = _('No wwn on host is connected to switch.')
        LOG.error(msg)
        raise exception.CinderException(msg)
Check FC port on array and wwn on host is connected to switch.

If no FC port on array is connected to switch or no ini on host is
connected to switch, raise a error.
def _check_fc_port_and_init(self, wwns, hostid, fabric_map, nsinfos):
    'Check FC port on array and wwn on host is connected to switch.\n\n        If no FC port on array is connected to switch or no ini on host is\n        connected to switch, raise a error.\n        '
    if (not fabric_map):
        msg = _('No FC port on array is connected to switch.')
        LOG.error(msg)
        raise exception.CinderException(msg)
    no_wwn_connected_to_switch = True
    for wwn in wwns:
        formatted_initiator = fczm_utils.get_formatted_wwn(wwn)
        for fabric in fabric_map:
            nsinfo = nsinfos[fabric]
            if (formatted_initiator in nsinfo):
                no_wwn_connected_to_switch = False
                self.client.ensure_fc_initiator_added(wwn, hostid)
                break
    if no_wwn_connected_to_switch:
        msg = _('No wwn on host is connected to switch.')
        LOG.error(msg)
        raise exception.CinderException(msg)