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.
This commit is contained in:
Frode Nordahl
2020-07-08 22:06:39 +02:00
parent f33d166c5e
commit 4d8c509133
+12 -1
View File
@@ -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),