diff options
author | 2017-06-13 09:18:57 +0800 | |
---|---|---|
committer | 2017-06-13 09:18:57 +0800 | |
commit | 01508fe34b6595f8b47ea808e433bc8cb210e94e (patch) | |
tree | a9c272e2e4f8ba3646eb4f8db9242d6b1fc82299 | |
parent | 8f681f8dcf0526e2db3d648234f89bf03bcc23df (diff) |
Changed logic to return only active availability zones.
Change-Id: I75d92976f4486933d432a8066159dbb66c12daf5
Signed-off-by: spisarski <s.pisarski@cablelabs.com>
-rw-r--r-- | snaps/openstack/utils/nova_utils.py | 5 |
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 |