X-Git-Url: https://osm.etsi.org/gitweb/?a=blobdiff_plain;f=osm_lcm%2Flcm_utils.py;h=7dac350bb383b6b640bca4c4d47ee277efc39731;hb=refs%2Fchanges%2F07%2F12707%2F2;hp=7af63a8f5680e61c7e08caacd56a218328738856;hpb=a37c6ff4d2afe2ee96f3515406210eed3ab1b30f;p=osm%2FLCM.git diff --git a/osm_lcm/lcm_utils.py b/osm_lcm/lcm_utils.py index 7af63a8..7dac350 100644 --- a/osm_lcm/lcm_utils.py +++ b/osm_lcm/lcm_utils.py @@ -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): """ @@ -319,9 +330,7 @@ class LcmBase: # Get the NSD package path if revision: - nsd_package_path = ( - db_nsr["nsd-id"] + ":" + str(revision) - ) + nsd_package_path = db_nsr["nsd-id"] + ":" + str(revision) db_nsd = self.db.get_one("nsds_revisions", {"_id": nsd_package_path}) else: