Fixed scale validation for sol006 60/10060/1
authorlloretgalleg <illoret@indra.es>
Tue, 1 Dec 2020 12:51:52 +0000 (12:51 +0000)
committerlloretgalleg <illoret@indra.es>
Tue, 1 Dec 2020 12:54:40 +0000 (12:54 +0000)
Change-Id: Iaee84eb1fcebd797abdaa76b248c167c4936692a
Signed-off-by: lloretgalleg <illoret@indra.es>
osm_nbi/instance_topics.py

index 2613430..8ae3a45 100644 (file)
@@ -738,12 +738,12 @@ class NsLcmOpTopic(BaseTopic):
     def _check_scale_ns_operation(self, indata, nsr):
         vnfd = self._get_vnfd_from_vnf_member_index(indata["scaleVnfData"]["scaleByStepData"]["member-vnf-index"],
                                                     nsr["_id"])
-        for scaling_group in get_iterable(vnfd.get("scaling-group-descriptor")):
-            if indata["scaleVnfData"]["scaleByStepData"]["scaling-group-descriptor"] == scaling_group["name"]:
+        for scaling_aspect in get_iterable(vnfd.get("df", ())[0]["scaling-aspect"]):
+            if indata["scaleVnfData"]["scaleByStepData"]["scaling-group-descriptor"] == scaling_aspect["id"]:
                 break
         else:
             raise EngineException("Invalid scaleVnfData:scaleByStepData:scaling-group-descriptor '{}' is not "
-                                  "present at vnfd:scaling-group-descriptor"
+                                  "present at vnfd:scaling-aspect"
                                   .format(indata["scaleVnfData"]["scaleByStepData"]["scaling-group-descriptor"]))
 
     def _check_instantiate_ns_operation(self, indata, nsr, session):