From 7543dfd87382d5323bb1c21fe6cd0b012048a27b Mon Sep 17 00:00:00 2001 From: Guillaume Boutry Date: Fri, 18 Oct 2024 17:13:48 +0200 Subject: [PATCH] Fallback to 0 minimum compute when no nova-compute units Tempests can be used on deployments without nova-compute, testing only control plane APIs. Fallback to a value when no nova-compute units is found. Signed-off-by: Guillaume Boutry --- zaza/openstack/charm_tests/tempest/utils.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/zaza/openstack/charm_tests/tempest/utils.py b/zaza/openstack/charm_tests/tempest/utils.py index 071ac29..31db6aa 100644 --- a/zaza/openstack/charm_tests/tempest/utils.py +++ b/zaza/openstack/charm_tests/tempest/utils.py @@ -245,7 +245,10 @@ def _add_nova_config(ctxt, keystone_session, missing_fatal=True): ctxt['flavor_ref'] = flavor.id if flavor.name == TEMPEST_ALT_FLAVOR_NAME: ctxt['flavor_ref_alt'] = flavor.id - ctxt['min_compute_nodes'] = len(model.get_units('nova-compute')) + try: + ctxt['min_compute_nodes'] = len(model.get_units('nova-compute')) + except KeyError: + ctxt['min_compute_nodes'] = 0 def _add_neutron_config(ctxt, keystone_session, missing_fatal=True):