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: