dont crash if param is not set in config.json
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Mathieu Broillet 2023-06-21 12:19:14 +02:00
parent bdc7d1bd03
commit eb997864e2
No known key found for this signature in database
GPG Key ID: 7D4F25BC50A0AA32

View File

@ -16,31 +16,31 @@ class LXC(LinuxMachine):
self.lxc_hostname = lxc_hostname
self.os = os
self.os_name = os["name"]
self.os_release = os["release"]
self.os_name = os.get("name")
self.os_release = os.get("release")
self.resources = resources
self.cpu = resources["cpu"]
self.memory = resources["memory"]
self.swap = resources["swap"]
self.disk = resources["disk"]
self.storage = resources["storage"]
self.cpu = resources.get("cpu")
self.memory = resources.get("memory")
self.swap = resources.get("swap")
self.disk = resources.get("disk")
self.storage = resources.get("storage")
self.network = network
self.bridge = network["bridge"]
self.ipv4 = network["ipv4"]
self.bridge = network.get("bridge")
self.ipv4 = network.get("ip")
self.ipv4_netmask = 0
self.ipv6 = network["ipv6"]
self.mac = network["mac"]
self.gateway4 = network["gateway4"]
self.gateway6 = network["gateway6"]
self.vlan = network["vlan"]
self.ipv6 = network.get("ip6")
self.mac = network.get("hwaddr")
self.gateway4 = network.get("gw")
self.gateway6 = network.get("gw6")
self.vlan = network.get("trunks")
self.options = options
self.privileged = options["privileged"]
self.start_on_boot = options["start_on_boot"]
self.startup_order = options["startup_order"]
self.password = options["password"]
self.privileged = options.get("privileged")
self.start_on_boot = options.get("start_on_boot")
self.startup_order = options.get("startup_order")
self.password = options.get("password")
self.creation = creation
self.deploy = deploy