aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjose.lausuch <jose.lausuch@ericsson.com>2016-07-07 14:23:42 +0200
committerjose.lausuch <jose.lausuch@ericsson.com>2016-07-07 14:23:42 +0200
commit19c88ef768e167465bc1c834e25e0f4cbac873b6 (patch)
treef607b9084994a521ae822b9e94a79c20b0bd7655
parentaa49985bda6e5a9935973c90aa13bda40eada399 (diff)
Fix function get_hypervisors in openstack utils
JIRA: FUNCTEST-99 Change-Id: I23fd3fae08255d36ec158e5a522640615b5d8a10 Signed-off-by: jose.lausuch <jose.lausuch@ericsson.com>
-rw-r--r--utils/openstack_utils.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/utils/openstack_utils.py b/utils/openstack_utils.py
index fcdce547..b463bf4a 100644
--- a/utils/openstack_utils.py
+++ b/utils/openstack_utils.py
@@ -183,7 +183,8 @@ def get_hypervisors(nova_client):
nodes = []
hypervisors = nova_client.hypervisors.list()
for hypervisor in hypervisors:
- nodes.append(hypervisor.hypervisor_hostname)
+ if hypervisor.state == "up":
+ nodes.append(hypervisor.hypervisor_hostname)
return nodes
except Exception, e:
print "Error [get_hypervisors(nova_client)]:", e