Fetch only 'up' state nodes for nova hypervisor list
Change-Id: I2ea545960365b666d4bd4dbb3f96613400ee804b
This commit is contained in:
@@ -24,7 +24,8 @@ class NovaHealth(object):
|
|||||||
hypervisors = self.novaclient.hypervisors.list()
|
hypervisors = self.novaclient.hypervisors.list()
|
||||||
except (ClientException, Exception) as e:
|
except (ClientException, Exception) as e:
|
||||||
return (400, e.message, [])
|
return (400, e.message, [])
|
||||||
hypervisor_names = [node.hypervisor_hostname for node in hypervisors]
|
hypervisor_names = [node.hypervisor_hostname for node in hypervisors
|
||||||
|
if node.state == "up"]
|
||||||
return (200, "success", hypervisor_names)
|
return (200, "success", hypervisor_names)
|
||||||
|
|
||||||
def nova_service_list(self):
|
def nova_service_list(self):
|
||||||
|
Reference in New Issue
Block a user