From c48c9398597cc212bd60d27255c9397e02a35323 Mon Sep 17 00:00:00 2001 From: Dmitrii Shcherbakov Date: Wed, 24 May 2023 17:03:36 +0300 Subject: [PATCH] Make net and subnet name customization optional https://github.com/openstack-charmers/zaza-openstack-tests/commit/ad16b5a7fc3a0971b168b133fbf0b5cbd55115fd ad16b5a7fc3a0971b168b133fbf0b5cbd55115fd introduced an option to customize network and subnet names, however, not all modules were updated to pass it into the setup_sdn method. Specificatlly, the dragent now breaks with a KeyError during the configure step. (Pdb) network_config["project_net_name"] *** KeyError: 'project_net_name' https://github.com/openstack-charmers/zaza-openstack-tests/blob/fdaf43f52c31656e445561477a7b7c468a73b89a/zaza/openstack/charm_tests/dragent/configure.py#L35-L46 --- zaza/openstack/configure/network.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/zaza/openstack/configure/network.py b/zaza/openstack/configure/network.py index d3bc5f7..20cde9f 100755 --- a/zaza/openstack/configure/network.py +++ b/zaza/openstack/configure/network.py @@ -167,7 +167,7 @@ def setup_sdn(network_config, keystone_session=None): project_id, shared=False, network_type=network_config["network_type"], - net_name=network_config["project_net_name"]) + net_name=network_config.get("project_net_name", "private")) project_subnet = openstack_utils.create_project_subnet( neutron_client, project_id, @@ -175,7 +175,8 @@ def setup_sdn(network_config, keystone_session=None): network_config.get("private_net_cidr"), subnetpool=subnetpool, ip_version=ip_version, - subnet_name=network_config["project_subnet_name"]) + subnet_name=network_config.get("project_subnet_name", + "private_subnet")) openstack_utils.update_subnet_dns( neutron_client, project_subnet,