Feature 10956: Implement upgrade of helm based EEs
[osm/LCM.git] / osm_lcm / lcm_utils.py
index 749f347..7dac350 100644 (file)
@@ -161,6 +161,17 @@ def populate_dict(target_dict, key_list, value):
     target_dict[key_list[-1]] = value
 
 
+def get_ee_id_parts(ee_id):
+    """
+    Parses ee_id stored at database that can be either 'version:namespace.helm_id' or only
+    namespace.helm_id for backward compatibility
+    If exists helm version can be helm-v3 or helm (helm-v2 old version)
+    """
+    version, _, part_id = ee_id.rpartition(":")
+    namespace, _, helm_id = part_id.rpartition(".")
+    return version, namespace, helm_id
+
+
 class LcmBase:
     def __init__(self, msg, logger):
         """