X-Git-Url: https://osm.etsi.org/gitweb/?p=osm%2FRO.git;a=blobdiff_plain;f=NG-RO%2Fosm_ng_ro%2Fns.py;h=2db33e497ee204a8957c87e733fe0bdda9052380;hp=660a5f57d3c9230307927bfdef11f7e536fcb851;hb=f29a91f8d792936bf9c264f3e6075784b58ebc68;hpb=884862293ce112b057813f5811ac4f6adbb5f8c2 diff --git a/NG-RO/osm_ng_ro/ns.py b/NG-RO/osm_ng_ro/ns.py index 660a5f57..2db33e49 100644 --- a/NG-RO/osm_ng_ro/ns.py +++ b/NG-RO/osm_ng_ro/ns.py @@ -681,15 +681,15 @@ class Ns(object): 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) - 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, + "dhcp_enabled": ip_profile.get("dhcp-params", {}).get( + "enabled", False + ), + "dhcp_start_address": ip_profile.get("dhcp-params", {}).get( + "start-address", None + ), + "dhcp_count": ip_profile.get("dhcp-params", {}).get( + "count", None + ), } if ip_profile.get("dns-server"):