Fix bug 2156 to select correct WIM connector class and prevent exceptions with missin...
[osm/RO.git] / NG-RO / osm_ng_ro / ns.py
index 501ef03..9a16241 100644 (file)
@@ -1653,7 +1653,7 @@ class Ns(object):
                     target_record_id = "{}.{}".format(db_record, existing_item["id"])
                     item_ = item
 
-                    if target_vim.startswith("sdn"):
+                    if target_vim.startswith("sdn") or target_vim.startswith("wim"):
                         # item must be sdn-net instead of net if target_vim is a sdn
                         item_ = "sdn_net"
                         target_record_id += ".sdn"
@@ -1701,7 +1701,7 @@ class Ns(object):
                 target_record_id = "{}.{}".format(db_record, target_item["id"])
                 item_ = item
 
-                if target_vim.startswith("sdn"):
+                if target_vim.startswith("sdn") or target_vim.startswith("wim"):
                     # item must be sdn-net instead of net if target_vim is a sdn
                     item_ = "sdn_net"
                     target_record_id += ".sdn"