X-Git-Url: https://osm.etsi.org/gitweb/?p=osm%2FRO.git;a=blobdiff_plain;f=NG-RO%2Fosm_ng_ro%2Fns.py;h=1c2e960a36e6ae4714c92948f1c003b3f33a137d;hp=f621051486ddf9aeb871e4284d83993be8c5c1d7;hb=239714b6df49d5d88a099e57006f1ac6e58a57a1;hpb=ae01f64d9c1d0b000590b9563074747cef213199 diff --git a/NG-RO/osm_ng_ro/ns.py b/NG-RO/osm_ng_ro/ns.py index f6210514..1c2e960a 100644 --- a/NG-RO/osm_ng_ro/ns.py +++ b/NG-RO/osm_ng_ro/ns.py @@ -510,10 +510,11 @@ class Ns(object): "ip_version": "IPv4" if "v4" in ip_profile.get("ip-version", "ipv4") else "IPv6", "subnet_address": ip_profile.get("subnet-address"), "gateway_address": ip_profile.get("gateway-address"), - "dhcp_enabled": ip_profile["dhcp-params"].get("enabled", True), - "dhcp_start_address": ip_profile["dhcp-params"].get("start-address"), - "dhcp_count": ip_profile["dhcp-params"].get("count"), - + "dhcp_enabled": ip_profile["dhcp-params"].get("enabled", True) + if "dhcp_params" in ip_profile else False, + "dhcp_start_address": ip_profile["dhcp-params"].get("start-address") + if "dhcp_params" in ip_profile else None, + "dhcp_count": ip_profile["dhcp-params"].get("count") if "dhcp_params" in ip_profile else None, } if ip_profile.get("dns-server"): ro_ip_profile["dns_address"] = ";".join([v["address"] for v in ip_profile["dns-server"]])