Fix AttributeError in multinode jobs
I62006b7e636b1773f4f41709cfec1fd6daae3c4f introduced a bug where
the `skip_checks` method tries to access a compute client but the
compute client is not yet setup because the `setup_clients` has
not been called yet (`skip_checks` is always called before `setup_clients`)
Hence the AttributeError.
The fix gets the number of compute nodes available through a newly introduced
config flag [1]. This way we don't dynamically discover the number of compute
nodes and we don't have to call any client.
[1]: I7d7230d100901179a1d1a0281aa8be990d00c02a
Closes-Bug: #1516561
Change-Id: I1b9474d2f0f0c2edea5ade4381c4c079804f10d5
diff --git a/tempest/api/compute/admin/test_live_migration.py b/tempest/api/compute/admin/test_live_migration.py
index ecb27c2..cfae772 100644
--- a/tempest/api/compute/admin/test_live_migration.py
+++ b/tempest/api/compute/admin/test_live_migration.py
@@ -35,7 +35,7 @@
skip_msg = ("%s skipped as live-migration is "
"not available" % cls.__name__)
raise cls.skipException(skip_msg)
- if len(cls._get_compute_hostnames()) < 2:
+ if CONF.compute.min_compute_nodes < 2:
raise cls.skipTest(
"Less than 2 compute nodes, skipping migration test.")