+def deep_get(target_dict, key_list, default_value=None):
+ """
+ Get a value from target_dict entering in the nested keys. If keys does not exist, it returns None
+ Example target_dict={a: {b: 5}}; key_list=[a,b] returns 5; both key_list=[a,b,c] and key_list=[f,h] return None
+ :param target_dict: dictionary to be read
+ :param key_list: list of keys to read from target_dict
+ :param default_value: value to return if key is not present in the nested dictionary
+ :return: The wanted value if exist, None otherwise
+ """
+ for key in key_list:
+ if not isinstance(target_dict, dict) or key not in target_dict:
+ return default_value
+ target_dict = target_dict[key]
+ return target_dict
+
+
+def get_iterable(in_dict, in_key):
+ """
+ Similar to <dict>.get(), but if value is None, False, ..., An empty tuple is returned instead
+ :param in_dict: a dictionary
+ :param in_key: the key to look for at in_dict
+ :return: in_dict[in_var] or () if it is None or not present
+ """
+ if not in_dict.get(in_key):
+ return ()
+ return in_dict[in_key]
+
+
+def check_juju_bundle_existence(vnfd: dict) -> str:
+ """Checks the existence of juju-bundle in the descriptor
+
+ Args:
+ vnfd: Descriptor as a dictionary
+
+ Returns:
+ Juju bundle if dictionary has juju-bundle else None
+
+ """
+ if vnfd.get("vnfd"):
+ vnfd = vnfd["vnfd"]
+
+ for kdu in vnfd.get("kdu", []):
+ return kdu.get("juju-bundle", None)
+
+
+def get_charm_artifact_path(base_folder, charm_name, charm_type, revision=str()) -> str:
+ """Finds the charm artifact paths
+
+ Args:
+ base_folder: Main folder which will be looked up for charm
+ charm_name: Charm name
+ charm_type: Type of charm native_charm, lxc_proxy_charm or k8s_proxy_charm
+ revision: vnf package revision number if there is
+
+ Returns:
+ artifact_path: (str)