summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--snaps/openstack/utils/nova_utils.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/snaps/openstack/utils/nova_utils.py b/snaps/openstack/utils/nova_utils.py
index 419f451..a1b959a 100644
--- a/snaps/openstack/utils/nova_utils.py
+++ b/snaps/openstack/utils/nova_utils.py
@@ -232,7 +232,7 @@ def delete_floating_ip(nova, floating_ip):
def get_nova_availability_zones(nova):
"""
- Returns the names of all nova compute servers
+ Returns the names of all nova active compute servers
:param nova: the Nova client
:return: a list of compute server names
"""
@@ -241,7 +241,8 @@ def get_nova_availability_zones(nova):
for zone in zones:
if zone.zoneName == 'nova':
for key, host in zone.hosts.items():
- out.append(zone.zoneName + ':' + key)
+ if host['nova-compute']['available']:
+ out.append(zone.zoneName + ':' + key)
return out