Make net and subnet name customization optional

https://github.com/openstack-charmers/zaza-openstack-tests/commit/ad16b5a7fc3a0971b168b133fbf0b5cbd55115fd

ad16b5a7fc 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
This commit is contained in:
Dmitrii Shcherbakov
2023-05-24 17:03:36 +03:00
parent 842637477c
commit c48c939859
+3 -2
View File
@@ -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,