Changes method for detecting package type, as the catalog option does not exist on... 47/9947/1
authorgarciaale <agarcia@whitestack.com>
Wed, 4 Nov 2020 18:46:38 +0000 (15:46 -0300)
committergarciaale <agarcia@whitestack.com>
Wed, 4 Nov 2020 18:46:38 +0000 (15:46 -0300)
Change-Id: I249ef23e7d569c159cdd6d6361020b7558ffd2e2
Signed-off-by: garciaale <agarcia@whitestack.com>
osmclient/common/utils.py

index ec0e0b0..6d5ebd8 100644 (file)
@@ -68,23 +68,11 @@ def get_key_val_from_pkg(descriptor_file):
 
     dict = yaml.safe_load(tar.extractfile(yamlfile))
     result = {}
-    for k1, v1 in list(dict.items()):
-        if not k1.endswith('-catalog'):
-            continue
-        for k2, v2 in v1.items():
-            if not k2.endswith('nsd') and not k2.endswith('vnfd'):
-                continue
+    for k in dict:
+        if 'nsd' in k:
+            result['type'] = 'nsd'
+        else:
+            result['type'] = 'vnfd'
 
-            if 'nsd' in k2:
-                result['type'] = 'nsd'
-            else:
-                result['type'] = 'vnfd'
-
-            for entry in v2:
-                for k3, v3 in list(entry.items()):
-                    # strip off preceeding chars before :
-                    key_name = k3.split(':').pop()
-
-                    result[key_name] = v3
     tar.close()
     return result