X-Git-Url: https://osm.etsi.org/gitweb/?a=blobdiff_plain;f=osm_lcm%2Fdata_utils%2Fvnfd.py;h=ffcb58278004ca119892d1303b7b0a550316d7da;hb=84bd9a7cee8c4686585f4ec53a95b163508c9d0b;hp=f8c11cad88a4a04e43692b0fbf8a593f91088855;hpb=78b6e6df5f70557276fa4814327c9237520f9ec2;p=osm%2FLCM.git diff --git a/osm_lcm/data_utils/vnfd.py b/osm_lcm/data_utils/vnfd.py index f8c11ca..ffcb582 100644 --- a/osm_lcm/data_utils/vnfd.py +++ b/osm_lcm/data_utils/vnfd.py @@ -169,3 +169,25 @@ def get_juju_ee_ref(vnfd, entity_id): get_configuration(vnfd, entity_id).get("execution-environment-list", []), lambda ee: "juju" in ee, ) + + +def find_software_version(vnfd: dict) -> str: + """Find the sotware version in the VNFD descriptors + + Args: + vnfd (dict): Descriptor as a dictionary + + Returns: + software-version (str) + """ + + default_sw_version = "1.0" + + if vnfd.get("vnfd"): + vnfd = vnfd["vnfd"] + + if vnfd.get("software-version"): + return vnfd["software-version"] + + else: + return default_sw_version