Fix minor issue 27/10327/2
authorDavid Garcia <david.garcia@canonical.com>
Tue, 16 Feb 2021 20:07:58 +0000 (21:07 +0100)
committerDavid Garcia <david.garcia@canonical.com>
Tue, 16 Feb 2021 20:14:29 +0000 (21:14 +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>
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