'Returns a host looked up via initiator.'

@proxy._trace_time
def _get_host(self, connector):

    try:
        host_bunch = self._get_bunch_from_host(connector)
    except Exception as e:
        details = self._get_code_and_status_or_message(e)
        msg = (_("%(prefix)s.    Invalid    connector:    '%(details)s.'") % {'prefix': storage.XIV_LOG_PREFIX, 'details': details})
        raise self._get_exception()(msg)
    host = []
    chap = None
    all_hosts = self._call_xiv_xcli('host_list').as_list
    if (self._get_connection_type() == storage.XIV_CONNECTION_TYPE_ISCSI):
        host = [host_obj for host_obj in all_hosts if (host_bunch['initiator'] in host_obj.iscsi_ports.split(','))]
    elif ('wwpns' in connector):
        if (len(host_bunch['wwpns']) > 0):
            wwpn_set = set([wwpn.lower() for wwpn in host_bunch['wwpns']])
            host = [host_obj for host_obj in all_hosts if (len(wwpn_set.intersection(host_obj.get('fc_ports', '').lower().split(','))) > 0)]
    else:
        host = [host_obj for host_obj in all_hosts if (host_obj.get('name', '') == connector['host'])]
    if (len(host) == 1):
        if (self._is_iscsi() and host[0].iscsi_chap_name):
            chap = (host[0].iscsi_chap_name, self._generate_chap_secret(host[0].iscsi_chap_name))
            LOG.debug('_get_host:    chap_name    %(chap_name)s    ', {'chap_name': host[0].iscsi_chap_name})
        return self._get_bunch_from_host(connector, host[0].id, host[0].name, chap)
    LOG.debug('_get_host:    returns    None')
    return None
