X-Git-Url: https://osm.etsi.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=osm_lcm%2Fns.py;h=0f92f9d91bc9ed2fcecc90ae5126d09591817608;hb=a8bbe67b84f4ef37107d882f0e7fab6ff6a1fc7e;hp=24783107924ce24945feeb092f2ff0e7ab830590;hpb=2357f4e54515ce965fcc5723d274c12ec12c01c7;p=osm%2FLCM.git diff --git a/osm_lcm/ns.py b/osm_lcm/ns.py index 2478310..0f92f9d 100644 --- a/osm_lcm/ns.py +++ b/osm_lcm/ns.py @@ -1498,6 +1498,7 @@ class NsLcm(LcmBase): vdu_index)) # New generation RO stores information at "vim_info" ng_ro_status = None + target_vim = None if vdur.get("vim_info"): target_vim = next(t for t in vdur["vim_info"]) # there should be only one key ng_ro_status = vdur["vim_info"][target_vim].get("vim_status") @@ -1506,7 +1507,10 @@ class NsLcm(LcmBase): if not ip_address: continue target_vdu_id = vdur["vdu-id-ref"] - elif vdur.get("status") == "ERROR" or vdur["vim_info"][target_vim].get("vim_status") == "ERROR": + elif ( + vdur.get("status") == "ERROR" or + vdur.get("vim_info", {}).get(target_vim, {}).get("vim_status") == "ERROR" + ): raise LcmException("Cannot inject ssh-key because target VM is in error state") if not target_vdu_id: @@ -1521,7 +1525,6 @@ class NsLcm(LcmBase): try: ro_vm_id = "{}-{}".format(db_vnfr["member-vnf-index-ref"], target_vdu_id) # TODO add vdu_index if self.ng_ro: - self.logger.debug(logging_text + "ALF lanzando orden") target = {"action": "inject_ssh_key", "key": pub_key, "user": user, "vnf": [{"_id": vnfr_id, "vdur": [{"id": vdur["id"]}]}], } @@ -1697,7 +1700,6 @@ class NsLcm(LcmBase): namespace=namespace, reuse_ee_id=ee_id, db_dict=db_dict, - config=osm_config, cloud_name=vca_cloud, credential_name=vca_cloud_credential, )