Fix bug 1160: remove get primitive from descritor for implicit actions on KDU 74/9474/2
authorgarciadeblas <gerardo.garciadeblas@telefonica.com>
Mon, 20 Jul 2020 11:05:42 +0000 (11:05 +0000)
committertierno <alfonso.tiernosepulveda@telefonica.com>
Thu, 23 Jul 2020 07:19:59 +0000 (09:19 +0200)
Change-Id: I14a1f6cc1aa4499b49dd4af4e15eddefcf92069a
Signed-off-by: garciadeblas <gerardo.garciadeblas@telefonica.com>
osm_lcm/ns.py

index 139c8e4..b7d10cd 100644 (file)
@@ -3596,11 +3596,15 @@ class NsLcm(LcmBase):
                         config_primitive_desc = config_primitive
                         break
 
-            if not config_primitive_desc and not (kdu_name and primitive in ("upgrade", "rollback", "status")):
-                raise LcmException("Primitive {} not found at [ns|vnf|vdu]-configuration:config-primitive ".
-                                   format(primitive))
-            primitive_name = config_primitive_desc.get("execution-environment-primitive", primitive)
-            ee_descriptor_id = config_primitive_desc.get("execution-environment-ref")
+            if not config_primitive_desc:
+                if not (kdu_name and primitive in ("upgrade", "rollback", "status")):
+                    raise LcmException("Primitive {} not found at [ns|vnf|vdu]-configuration:config-primitive ".
+                                       format(primitive))
+                primitive_name = primitive
+                ee_descriptor_id = None
+            else:
+                primitive_name = config_primitive_desc.get("execution-environment-primitive", primitive)
+                ee_descriptor_id = config_primitive_desc.get("execution-environment-ref")
 
             if vnf_index:
                 if vdu_id: