Fix bug 2157 to resolve issues with IETF L2VPN WIM connector
[osm/RO.git] / NG-RO / osm_ng_ro / ns_thread.py
index d2b00d6..6e9f104 100644 (file)
@@ -1841,7 +1841,10 @@ class NsWorker(threading.Thread):
                 wim = deepcopy(vim)
                 wim_config = wim.pop("config", {}) or {}
                 wim["uuid"] = wim["_id"]
-                wim["wim_url"] = wim["url"]
+                if "url" in wim and "wim_url" not in wim:
+                    wim["wim_url"] = wim["url"]
+                elif "url" not in wim and "wim_url" in wim:
+                    wim["url"] = wim["wim_url"]
 
                 if wim.get("dpid"):
                     wim_config["dpid"] = wim.pop("dpid")