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.lxc_hostname = lxc_hostname
self.os = os self.os = os
self.os_name = os["name"] self.os_name = os.get("name")
self.os_release = os["release"] self.os_release = os.get("release")
self.resources = resources self.resources = resources
self.cpu = resources["cpu"] self.cpu = resources.get("cpu")
self.memory = resources["memory"] self.memory = resources.get("memory")
self.swap = resources["swap"] self.swap = resources.get("swap")
self.disk = resources["disk"] self.disk = resources.get("disk")
self.storage = resources["storage"] self.storage = resources.get("storage")
self.network = network self.network = network
self.bridge = network["bridge"] self.bridge = network.get("bridge")
self.ipv4 = network["ipv4"] self.ipv4 = network.get("ip")
self.ipv4_netmask = 0 self.ipv4_netmask = 0
self.ipv6 = network["ipv6"] self.ipv6 = network.get("ip6")
self.mac = network["mac"] self.mac = network.get("hwaddr")
self.gateway4 = network["gateway4"] self.gateway4 = network.get("gw")
self.gateway6 = network["gateway6"] self.gateway6 = network.get("gw6")
self.vlan = network["vlan"] self.vlan = network.get("trunks")
self.options = options self.options = options
self.privileged = options["privileged"] self.privileged = options.get("privileged")
self.start_on_boot = options["start_on_boot"] self.start_on_boot = options.get("start_on_boot")
self.startup_order = options["startup_order"] self.startup_order = options.get("startup_order")
self.password = options["password"] self.password = options.get("password")
self.creation = creation self.creation = creation
self.deploy = deploy self.deploy = deploy