diff options
Diffstat (limited to 'functest/core')
-rw-r--r-- | functest/core/singlevm.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/functest/core/singlevm.py b/functest/core/singlevm.py index 0473a21da..734eb22d5 100644 --- a/functest/core/singlevm.py +++ b/functest/core/singlevm.py @@ -256,6 +256,14 @@ class VmReady1(tenantnetwork.TenantNetwork1): self.__logger.debug( "Orphan security group %s in use", sec_group.id) + def count_active_hypervisors(self): + """Count all hypervisors which are up.""" + compute_cnt = 0 + for hypervisor in self.orig_cloud.list_hypervisors(): + if hypervisor['state'] == 'up': + compute_cnt += 1 + return compute_cnt + def run(self, **kwargs): """Boot the new VM |