Bug 1051 addressed to identify if multiple VIM accounts passed to ns-create belong...
[osm/RO.git] / RO / osm_ro / nfvo.py
index 9e48c4a..f06bce4 100644 (file)
@@ -3315,7 +3315,10 @@ def create_instance(mydb, tenant_id, instance_dict):
             # TODO: use this information during network creation
             wim_account_id = wim_account_name = None
             if len(involved_datacenters) > 1 and 'uuid' in sce_net:
-                if target_wim_account is None or target_wim_account is True:  # automatic selection of WIM
+                urls = [myvims[v].url for v in involved_datacenters]
+                if len(set(urls)) < 2:
+                    wim_usage[sce_net['uuid']] = False
+                elif target_wim_account is None or target_wim_account is True:  # automatic selection of WIM
                     # OBS: sce_net without uuid are used internally to VNFs
                     # and the assumption is that VNFs will not be split among
                     # different datacenters
@@ -5325,7 +5328,7 @@ def edit_vim_account(mydb, nfvo_tenant, datacenter_tenant_id, datacenter_id=None
     if config:
         original_config_dict = yaml.load(original_config, Loader=yaml.Loader)
         original_config_dict.update(config)
-        update["config"] = yaml.safe_dump(original_config_dict, default_flow_style=True, width=256)
+        update_["config"] = yaml.safe_dump(original_config_dict, default_flow_style=True, width=256)
     if name:
         update_['name'] = name
     if vim_tenant: