From: garciadeblas Date: Tue, 28 Aug 2018 11:21:24 +0000 (+0200) Subject: Fix bug 533 passing DNS addresses to the RO X-Git-Tag: v5.0.0~29 X-Git-Url: https://osm.etsi.org/gitweb/?a=commitdiff_plain;h=refs%2Fchanges%2F36%2F6436%2F2;p=osm%2FLCM.git Fix bug 533 passing DNS addresses to the RO Change-Id: Ice25f2cb61f6a4eabf9fa8ae216a6b067b2672bb Signed-off-by: garciadeblas --- diff --git a/osm_lcm/lcm.py b/osm_lcm/lcm.py index 1c1bb11..88c95ca 100644 --- a/osm_lcm/lcm.py +++ b/osm_lcm/lcm.py @@ -817,7 +817,12 @@ class Lcm: def ip_profile_2_RO(ip_profile): RO_ip_profile = deepcopy((ip_profile)) if "dns-server" in RO_ip_profile: - RO_ip_profile["dns-address"] = RO_ip_profile.pop("dns-server") + if isinstance(RO_ip_profile["dns-server"], list): + RO_ip_profile["dns-address"] = [] + for ds in RO_ip_profile.pop("dns-server"): + RO_ip_profile["dns-address"].append(ds['address']) + else: + RO_ip_profile["dns-address"] = RO_ip_profile.pop("dns-server") if RO_ip_profile.get("ip-version") == "ipv4": RO_ip_profile["ip-version"] = "IPv4" if RO_ip_profile.get("ip-version") == "ipv6":