X-Git-Url: https://osm.etsi.org/gitweb/?p=osm%2FN2VC.git;a=blobdiff_plain;f=n2vc%2Fn2vc_juju_conn.py;fp=n2vc%2Fn2vc_juju_conn.py;h=f0569b18b0fd0b81f86a9aa8ee7929382a6e6ec9;hp=5dc394ca9e5f2e1cf72ae2b7ad7186a472943ded;hb=4c856b3bae4f30d9e1bdd429884c1ae84bc629f0;hpb=01244641fdac89ce2afd5490e5c6d2bcf7ad05ae diff --git a/n2vc/n2vc_juju_conn.py b/n2vc/n2vc_juju_conn.py index 5dc394c..f0569b1 100644 --- a/n2vc/n2vc_juju_conn.py +++ b/n2vc/n2vc_juju_conn.py @@ -1338,7 +1338,18 @@ class N2VCJujuConnector(N2VCConnector): elif charm_level == "vdu-level": if len(vca_records) < 1: raise N2VCException(message="One or more VCA record is expected.") - vdu_profile_id = vnfrs["vdur"][int(vdu_count)]["vdu-id-ref"] + + # Charms are also used for deployments with Helm charts. + # If deployment unit is a Helm chart/KDU, + # vdu_profile_id and vdu_count will be empty string. + vdu_profile_id = "" + + if vdu_count is None: + vdu_count = "" + + elif vdu_count: + vdu_profile_id = vnfrs["vdur"][int(vdu_count)]["vdu-id-ref"] + # If vnf/vdu is scaled, more than one VCA record may be included in vca_records # but ee_descriptor_id is same. # Shorten the ee_descriptor_id, member-vnf-index-ref and vdu_profile_id