Do not set NetworkName by default
This commit is contained in:
parent
689d377683
commit
a429621e42
3
main.py
3
main.py
@ -81,6 +81,7 @@ def write_network_units(args, yaml_dict):
|
|||||||
unit_file["Unit"]["Description"] = f"{network_name.capitalize()} network"
|
unit_file["Unit"]["Description"] = f"{network_name.capitalize()} network"
|
||||||
|
|
||||||
unit_file["Network"] = {}
|
unit_file["Network"] = {}
|
||||||
|
if "name" in network:
|
||||||
unit_file["Network"]["NetworkName"] = network_name
|
unit_file["Network"]["NetworkName"] = network_name
|
||||||
unit_file["Network"]["Internal"] = str(network.get("internal", True)).lower()
|
unit_file["Network"]["Internal"] = str(network.get("internal", True)).lower()
|
||||||
if "enable_ipv6" in network:
|
if "enable_ipv6" in network:
|
||||||
@ -153,7 +154,7 @@ def write_service_units(args, yaml_dict):
|
|||||||
unit_file["Container"]["Volume"] = service["volumes"]
|
unit_file["Container"]["Volume"] = service["volumes"]
|
||||||
if "networks" in service:
|
if "networks" in service:
|
||||||
enforce_list("networks", 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:
|
else:
|
||||||
unit_file["Container"]["Network"] = ["default"]
|
unit_file["Container"]["Network"] = ["default"]
|
||||||
if "devices" in service:
|
if "devices" in service:
|
||||||
|
Loading…
Reference in New Issue
Block a user