X-Git-Url: https://osm.etsi.org/gitweb/?a=blobdiff_plain;f=osm_lcm%2Fns.py;h=5cd55fbb3b21a9d0db5c772f6f34db498e87757d;hb=a9f4d008967fd25dcbcae83ac01c66f013f48c4f;hp=8ef5f2acc05525cd78d41896dbe5331a9f0089c8;hpb=1a122f30f70508a057975bc2921c00dbf2b4f36f;p=osm%2FLCM.git diff --git a/osm_lcm/ns.py b/osm_lcm/ns.py index 8ef5f2a..5cd55fb 100644 --- a/osm_lcm/ns.py +++ b/osm_lcm/ns.py @@ -1934,6 +1934,9 @@ class NsLcm(LcmBase): step = "Waiting to VM being up and getting IP address" self.logger.debug(logging_text + step) + # default rw_mgmt_ip to None, avoiding the non definition of the variable + rw_mgmt_ip = None + # n2vc_redesign STEP 5.1 # wait for RO (ip-address) Insert pub_key into VM if vnfr_id: @@ -1941,7 +1944,13 @@ class NsLcm(LcmBase): rw_mgmt_ip = await self.wait_kdu_up( logging_text, nsr_id, vnfr_id, kdu_name ) - else: + + # This verification is needed in order to avoid trying to add a public key + # to a VM, when the VNF is a KNF (in the edge case where the user creates a VCA + # for a KNF and not for its KDUs, the previous verification gives False, and the code + # jumps to this block, meaning that there is the need to verify if the VNF is actually a VNF + # or it is a KNF) + elif db_vnfr.get('vdur'): rw_mgmt_ip = await self.wait_vm_up_insert_key_ro( logging_text, nsr_id, @@ -1951,8 +1960,6 @@ class NsLcm(LcmBase): user=user, pub_key=pub_key, ) - else: - rw_mgmt_ip = None # This is for a NS configuration self.logger.debug(logging_text + " VM_ip_address={}".format(rw_mgmt_ip))