From a429621e42d09784b894dfd8c5cee2e133a30831 Mon Sep 17 00:00:00 2001 From: Faerbit Date: Mon, 4 Nov 2024 00:48:28 +0100 Subject: [PATCH] Do not set NetworkName by default --- main.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/main.py b/main.py index fffdc98..fa6d71d 100755 --- a/main.py +++ b/main.py @@ -81,7 +81,8 @@ def write_network_units(args, yaml_dict): unit_file["Unit"]["Description"] = f"{network_name.capitalize()} network" unit_file["Network"] = {} - unit_file["Network"]["NetworkName"] = network_name + if "name" in network: + unit_file["Network"]["NetworkName"] = network_name unit_file["Network"]["Internal"] = str(network.get("internal", True)).lower() if "enable_ipv6" in network: unit_file["Network"]["IPv6"] = str(network["enable_ipv6"]).lower() @@ -153,7 +154,7 @@ def write_service_units(args, yaml_dict): unit_file["Container"]["Volume"] = service["volumes"] if "networks" in service: enforce_list("networks", service) - unit_file["Container"]["Network"] = service["networks"] + unit_file["Container"]["Network"] = list(map(lambda x: f"{x}.network", service["networks"])) else: unit_file["Container"]["Network"] = ["default"] if "devices" in service: