Merge "Use limit -1 for nova servers list"

This commit is contained in:
Zuul
2018-10-22 10:47:31 +00:00
committed by Gerrit Code Review

View File

@@ -74,7 +74,8 @@ class NovaHelper(object):
raise exception.ComputeNodeNotFound(name=node_hostname) raise exception.ComputeNodeNotFound(name=node_hostname)
def get_instance_list(self): def get_instance_list(self):
return self.nova.servers.list(search_opts={'all_tenants': True}) return self.nova.servers.list(search_opts={'all_tenants': True},
limit=-1)
def get_flavor_list(self): def get_flavor_list(self):
return self.nova.flavors.list(**{'is_public': None}) return self.nova.flavors.list(**{'is_public': None})
@@ -704,7 +705,8 @@ class NovaHelper(object):
def get_instances_by_node(self, host): def get_instances_by_node(self, host):
return [instance for instance in return [instance for instance in
self.nova.servers.list(search_opts={"all_tenants": True}) self.nova.servers.list(search_opts={"all_tenants": True},
limit=-1)
if self.get_hostname(instance) == host] if self.get_hostname(instance) == host]
def get_hostname(self, instance): def get_hostname(self, instance):