From 39deab759e1ad6e2bf0f42a56a639562c30ae3e0 Mon Sep 17 00:00:00 2001 From: sousaedu Date: Tue, 2 Mar 2021 01:42:51 +0100 Subject: [PATCH] Fix bug 1408 Change-Id: I6ab12eb0aa9532676642cbf59db8ccc2f33c420b Signed-off-by: sousaedu --- NG-RO/osm_ng_ro/ns.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) 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"): -- 2.25.1