diff options
author | Cedric Ollivier <cedric.ollivier@orange.com> | 2019-10-01 08:40:30 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@opnfv.org> | 2019-10-01 08:40:30 +0000 |
commit | 8e006458285fbfde4e4c6c421b05e308eb5d4583 (patch) | |
tree | fe43c12b3a16e5ebcb060f3946135e3518e85c4e /functest/core/singlevm.py | |
parent | 1eb836f24b082754c3a00899dbafb0330b68db6a (diff) | |
parent | 7babc714b760a5953abd9098a669307aa44a1966 (diff) |
Merge "Count all active hypervisors" into stable/hunter
Diffstat (limited to 'functest/core/singlevm.py')
-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 1da30de34..cebb7cc84 100644 --- a/functest/core/singlevm.py +++ b/functest/core/singlevm.py @@ -257,6 +257,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 |