From 4d8c5091330ef2468c64386eac30cf6b890ca1cf Mon Sep 17 00:00:00 2001 From: Frode Nordahl Date: Wed, 8 Jul 2020 22:06:39 +0200 Subject: [PATCH] Make the use of juju_wait configurable For compatibility with existing scenario tests the `configure_gateway_ext_port` helper currently make use of `juju_wait` when configuring the deployed cloud. This does not work well if the model you are testing has applications with non-standard workload status messaging. Allow to override the behaviour through config step options. --- zaza/openstack/utilities/openstack.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/zaza/openstack/utilities/openstack.py b/zaza/openstack/utilities/openstack.py index 14c708c..c5e2bfa 100644 --- a/zaza/openstack/utilities/openstack.py +++ b/zaza/openstack/utilities/openstack.py @@ -63,6 +63,9 @@ import tenacity import textwrap import urllib +import zaza +import zaza.charm_lifecycle.utils as lifecycle_utils + from zaza import model from zaza.openstack.utilities import ( exceptions, @@ -794,7 +797,15 @@ def configure_gateway_ext_port(novaclient, neutronclient, net_id=None, # NOTE(fnordahl): We are stuck with juju_wait until we figure out how # to deal with all the non ['active', 'idle', 'Unit is ready.'] # workload/agent states and msgs that our mojo specs are exposed to. - juju_wait.wait(wait_for_workload=True) + if lifecycle_utils.get_config_options().get( + 'configure_gateway_ext_port_use_juju_wait', True): + juju_wait.wait(wait_for_workload=True) + else: + zaza.model.wait_for_agent_status() + test_config = zaza.charm_lifecycle.utils.get_charm_config( + fatal=False) + zaza.model.wait_for_application_states( + states=test_config.get('target_deploy_status', {})) @tenacity.retry(wait=tenacity.wait_exponential(multiplier=1, max=60),