Fix minor issue 28/10328/1
authorDavid Garcia <david.garcia@canonical.com>
Tue, 16 Feb 2021 20:07:58 +0000 (21:07 +0100)
committerbravof <fbravo@whitestack.com>
Tue, 16 Feb 2021 20:25:12 +0000 (21:25 +0100)
If initial-config-primitive or config-primitive do not exists, there was
an error.

Change-Id: If43cef7369a5f6d57c99347ba8a4b7b08790d057
Signed-off-by: David Garcia <david.garcia@canonical.com>
(cherry picked from commit 95cc9c5f864ef0d5b78eca278e41a023d7e79281)

osm_lcm/ns.py

index 8e0beb6..5131f9f 100644 (file)
@@ -3447,9 +3447,9 @@ class NsLcm(LcmBase):
             if kdu_name and get_kdu_configuration(db_vnfd, kdu_name):
                 kdu_configuration = get_kdu_configuration(db_vnfd, kdu_name)
                 actions = set()
-                for primitive in kdu_configuration["initial-config-primitive"]:
+                for primitive in kdu_configuration.get("initial-config-primitive", []):
                     actions.add(primitive["name"])
-                for primitive in kdu_configuration["config-primitive"]:
+                for primitive in kdu_configuration.get("config-primitive", []):
                     actions.add(primitive["name"])
                 kdu_action = True if primitive_name in actions else False