Fix bug 1904 for EPA tests (no valid hostname) 54/11754/3
authorgallardo <sgallardor@indra.es>
Mon, 14 Mar 2022 18:16:41 +0000 (18:16 +0000)
committeraticig <gulsum.atici@canonical.com>
Tue, 15 Mar 2022 09:49:47 +0000 (12:49 +0300)
Change-Id: Ia2f2b71812e46f33144178d342c3559e54d8a03c
Signed-off-by: gallardo <sgallardor@indra.es>
NG-RO/osm_ng_ro/ns.py
releasenotes/notes/fix_bug_1904-27a920480a14d3b7.yaml [new file with mode: 0644]

index f3b073e..8e2f827 100644 (file)
@@ -1000,10 +1000,13 @@ class Ns(object):
                 if deep_get(
                     tasks_by_target_record_id,
                     net_text,
+                    "extra_dict",
                     "params",
                     "net_type",
                 ):
-                    tasks_by_target_record_id[net_text]["params"]["net_type"] = "data"
+                    tasks_by_target_record_id[net_text]["extra_dict"]["params"][
+                        "net_type"
+                    ] = "data"
 
                 net_item["use"] = "data"
                 net_item["model"] = interface["type"]
@@ -1285,18 +1288,18 @@ class Ns(object):
                     "task_index": task_index,
                 }
 
-                diff_items.append(
-                    {
-                        "deployment_info": deployment_info,
-                        "target_id": target_vim,
-                        "item": item_,
-                        "action": "CREATE",
-                        "target_record": f"{db_record}.{item_index}.vim_info.{target_vim}",
-                        "target_record_id": target_record_id,
-                        "extra_dict": extra_dict,
-                        "common_id": target_item.get("common_id", None),
-                    }
-                )
+                new_item = {
+                    "deployment_info": deployment_info,
+                    "target_id": target_vim,
+                    "item": item_,
+                    "action": "CREATE",
+                    "target_record": f"{db_record}.{item_index}.vim_info.{target_vim}",
+                    "target_record_id": target_record_id,
+                    "extra_dict": extra_dict,
+                    "common_id": target_item.get("common_id", None),
+                }
+                diff_items.append(new_item)
+                tasks_by_target_record_id[target_record_id] = new_item
                 task_index += 1
 
                 db_nsr_update[db_path + ".{}".format(item_index)] = target_item
diff --git a/releasenotes/notes/fix_bug_1904-27a920480a14d3b7.yaml b/releasenotes/notes/fix_bug_1904-27a920480a14d3b7.yaml
new file mode 100644 (file)
index 0000000..6e5bc48
--- /dev/null
@@ -0,0 +1,23 @@
+#######################################################################################
+# Copyright ETSI Contributors and Others.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#    http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+# implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#######################################################################################
+---
+
+fixes:
+  - |
+    Fixing Bug 1904 - Openstack related error "No valid host was found. There are not enough hosts available."
+    error which is meet at EPA01, EPA04 robot tests are fixed.
+