'Return the Storwize host described by the connector.'

def get_host_from_connector(self, connector, volume_name=None, iscsi=False):

    LOG.debug('Enter:    get_host_from_connector:    %s.', connector)
    host_name = None
    if (('wwpns' in connector) and (not iscsi)):
        for wwpn in connector['wwpns']:
            resp = self.ssh.lsfabric(wwpn=wwpn)
            for wwpn_info in resp:
                try:
                    if (wwpn_info['remote_wwpn'] and wwpn_info['name'] and (wwpn_info['remote_wwpn'].lower() == wwpn.lower())):
                        host_name = wwpn_info['name']
                        break
                except KeyError:
                    self.handle_keyerror('lsfabric', wwpn_info)
            if host_name:
                break
    if host_name:
        LOG.debug('Leave:    get_host_from_connector:    host    %s.', host_name)
        return host_name
    def update_host_list(host, host_list):
        idx = host_list.index(host)
        del host_list[idx]
        host_list.insert(0, host)
    hosts_info = self.ssh.lshost()
    host_list = list(hosts_info.select('name'))
    if ('host' in connector):
        for host in host_list:
            if re.search(connector['host'], host):
                update_host_list(host, host_list)
    if volume_name:
        hosts_map_info = self.ssh.lsvdiskhostmap(volume_name)
        hosts_map_info_list = list(hosts_map_info.select('host_name'))
        for host in hosts_map_info_list:
            update_host_list(host, host_list)
    found = False
    for name in host_list:
        try:
            resp = self.ssh.lshost(host=name)
        except exception.VolumeBackendAPIException as ex:
            LOG.debug('Exception    message:    %s', ex.msg)
            if ('CMMVC5754E' in ex.msg):
                LOG.debug('CMMVC5754E    found    in    CLI    exception.')
                continue
            with excutils.save_and_reraise_exception():
                pass
        if iscsi:
            if ('initiator' in connector):
                for iscsi in resp.select('iscsi_name'):
                    if (iscsi == connector['initiator']):
                        host_name = name
                        found = True
                        break
        elif (('wwpns' in connector) and len(connector['wwpns'])):
            connector_wwpns = [str(x).lower() for x in connector['wwpns']]
            for wwpn in resp.select('WWPN'):
                if (wwpn and (wwpn.lower() in connector_wwpns)):
                    host_name = name
                    found = True
                    break
        if found:
            break
    LOG.debug('Leave:    get_host_from_connector:    host    %s.', host_name)
    return host_name
