From 50353b4625699b820ec5107bc0aa374783f47137 Mon Sep 17 00:00:00 2001 From: Aurelien Lourot Date: Thu, 4 Nov 2021 11:42:06 +0100 Subject: [PATCH] Support 'to-be-set' value for 'data-port' See https://github.com/openstack-charmers/openstack-bundles/pull/228 --- zaza/openstack/utilities/openstack.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/zaza/openstack/utilities/openstack.py b/zaza/openstack/utilities/openstack.py index 2f19905..d34f838 100644 --- a/zaza/openstack/utilities/openstack.py +++ b/zaza/openstack/utilities/openstack.py @@ -986,7 +986,19 @@ def configure_networking_charms(networking_data, macs, use_juju_wait=True): current_data_port = get_application_config_option( application_name, networking_data.port_config_key) - if current_data_port: + + # NOTE(lourot): in + # https://github.com/openstack-charmers/openstack-bundles we have made + # the conscious choice to use 'to-be-set' instead of 'null' for the + # following reasons: + # * With 'to-be-set' (rather than 'null') it is clearer for the reader + # that some action is required and the value can't just be left as + # is. + # * Some of our tooling doesn't work with 'null', see + # https://github.com/openstack-charmers/openstack-bundles/pull/228 + # This nonetheless supports both by exiting early if the value is + # neither 'null' nor 'to-be-set': + if current_data_port and current_data_port != 'to-be-set': logging.info("Skip update of external network data port config." "Config '{}' already set to value: {}".format( networking_data.port_config_key,