From: jose.lausuch Date: Thu, 7 Jul 2016 12:23:42 +0000 (+0200) Subject: Fix function get_hypervisors in openstack utils X-Git-Tag: colorado.1.0~268 X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F51%2F16551%2F1;p=functest.git Fix function get_hypervisors in openstack utils JIRA: FUNCTEST-99 Change-Id: I23fd3fae08255d36ec158e5a522640615b5d8a10 Signed-off-by: jose.lausuch --- diff --git a/utils/openstack_utils.py b/utils/openstack_utils.py index fcdce5471..b463bf4ae 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