Fix bug 533 passing DNS addresses to the RO 36/6436/2
authorgarciadeblas <gerardo.garciadeblas@telefonica.com>
Tue, 28 Aug 2018 11:21:24 +0000 (13:21 +0200)
committergarciadeblas <gerardo.garciadeblas@telefonica.com>
Wed, 29 Aug 2018 12:53:47 +0000 (14:53 +0200)
Change-Id: Ice25f2cb61f6a4eabf9fa8ae216a6b067b2672bb
Signed-off-by: garciadeblas <gerardo.garciadeblas@telefonica.com>
osm_lcm/lcm.py

index 1c1bb11..88c95ca 100644 (file)
@@ -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":