def _quote_domain(domain):
    """Special quoting rule for placing domain names on a url line.

    Domain names tend to have .'s in them.  Urllib doesn't quote dots,
    but Routes tends to choke on them, so we need an extra level of
    by-hand quoting here.
    """
    return urlutils.quote(domain.replace('.', '%2E'))
    def search(self, hypervisor_match):
        """
        Get a list of matching hypervisors.

        :param servers: If True, server information is also retrieved.
        """
        url = ('/os-hypervisors/search?query=%s' %
               urlutils.quote(hypervisor_match, safe=''))
        return self._list(url, 'hypervisors')
Beispiel #3
0
    def search(self, hypervisor_match, servers=False):
        """
        Get a list of matching hypervisors.

        :param servers: If True, server information is also retrieved.
        """
        target = 'servers' if servers else 'search'
        url = ('/os-hypervisors/%s/%s' %
               (urlutils.quote(hypervisor_match, safe=''), target))
        return self._list(url, 'hypervisors')
    def search(self, hypervisor_match, servers=False):
        """
        Get a list of matching hypervisors.

        :param servers: If True, server information is also retrieved.
        """
        target = 'servers' if servers else 'search'
        url = ('/os-hypervisors/%s/%s' %
               (urlutils.quote(hypervisor_match, safe=''), target))
        return self._list(url, 'hypervisors')