[VVP] create new validation scripts
[vvp/validation-scripts.git] / ice_validator / tests / utils / nested_iterables.py
index 47b0609..b6deaba 100644 (file)
@@ -6,7 +6,7 @@
 # ===================================================================
 #
 # Unless otherwise specified, all software contained herein is licensed
-# under the Apache License, Version 2.0 (the “License”);
+# under the Apache License, Version 2.0 (the "License");
 # you may not use this software except in compliance with the License.
 # You may obtain a copy of the License at
 #
@@ -21,7 +21,7 @@
 #
 #
 # Unless otherwise specified, all documentation contained herein is licensed
-# under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+# under the Creative Commons License, Attribution 4.0 Intl. (the "License");
 # you may not use this documentation except in compliance with the License.
 # You may obtain a copy of the License at
 #
@@ -73,11 +73,19 @@ def find_all_get_param_in_yml(yml):
     params = []
     for k, v in yml.items():
         if k == 'get_param' and v not in os_pseudo_parameters:
+            if isinstance(v, list) and not isinstance(v[0], dict):
+                params.append(v[0])
+            elif not isinstance(v, dict) and isinstance(v, str):
+                params.append(v)
             for item in (v if isinstance(v, list) else [v]):
                 if isinstance(item, dict):
                     params.extend(find_all_get_param_in_yml(item))
-                elif isinstance(item, str):
-                    params.append(item)
+            continue
+        elif k == 'list_join':
+            for item in (v if isinstance(v, list) else [v]):
+                if isinstance(item, list):
+                    for d in item:
+                        params.extend(find_all_get_param_in_yml(d))
             continue
         if isinstance(v, dict):
             params.extend(find_all_get_param_in_yml(v))