From: David Garcia Date: Thu, 21 Oct 2021 15:03:48 +0000 (+0200) Subject: Fix 1716: get nsr vca id from vim account X-Git-Tag: release-v11.0-start~1 X-Git-Url: https://osm.etsi.org/gitweb/?p=osm%2FLCM.git;a=commitdiff_plain;h=5506c1831e40b5a8086ec5037f2b791802526952 Fix 1716: get nsr vca id from vim account Change-Id: I814e8c2e9f4ad4fb973958abe5c9453138f701fb Signed-off-by: David Garcia --- diff --git a/osm_lcm/ns.py b/osm_lcm/ns.py index 1c18ec7..fc2c9f6 100644 --- a/osm_lcm/ns.py +++ b/osm_lcm/ns.py @@ -1557,9 +1557,13 @@ class NsLcm(LcmBase): raise LcmException("Configuration aborted because dependent charm/s timeout") def get_vca_id(self, db_vnfr: dict, db_nsr: dict): - return deep_get(db_vnfr, ("vca-id",)) or deep_get( - db_nsr, ("instantiate_params", "vcaId") - ) + vca_id = None + if db_vnfr: + vca_id = deep_get(db_vnfr, ("vca-id",)) + elif db_nsr: + vim_account_id = deep_get(db_nsr, ("instantiate_params", "vimAccountId")) + vca_id = VimAccountDB.get_vim_account_with_id(vim_account_id).get("vca") + return vca_id async def instantiate_N2VC( self,