From: tierno Date: Thu, 13 Jun 2019 16:05:28 +0000 (+0000) Subject: bug 769 fix execution of initial-primitives when combining vnf and vdu configuration X-Git-Tag: v6.0.0 X-Git-Url: https://osm.etsi.org/gitweb/?a=commitdiff_plain;h=d60e2385f64871bd64d5a6d4066b9b5e15ada4a6;p=osm%2FLCM.git bug 769 fix execution of initial-primitives when combining vnf and vdu configuration Change-Id: I8d1a83a6a34e306d79f76c2f045e49685401db7e Signed-off-by: tierno --- diff --git a/osm_lcm/lcm.py b/osm_lcm/lcm.py index c4e5eed..3c7a205 100644 --- a/osm_lcm/lcm.py +++ b/osm_lcm/lcm.py @@ -46,8 +46,8 @@ min_RO_version = [0, 6, 3] min_n2vc_version = "0.0.2" min_common_version = "0.1.19" # uncomment if LCM is installed as library and installed, and get them from __init__.py -lcm_version = '0.1.37' -lcm_version_date = '2019-04-30' +lcm_version = '0.1.40' +lcm_version_date = '2019-06-13' health_check_file = path.expanduser("~") + "/time_last_ping" # TODO find better location for this file diff --git a/osm_lcm/ns.py b/osm_lcm/ns.py index fe8fc65..caadce1 100644 --- a/osm_lcm/ns.py +++ b/osm_lcm/ns.py @@ -1208,8 +1208,8 @@ class NsLcm(LcmBase): for vdu_index, vdu in enumerate(get_iterable(vnfd, 'vdu')): if vdu["id"] == vdu_id: initial_config_primitive_list = vdu['vdu-configuration'].get( - 'initial-config-primitive', ()) - break + 'initial-config-primitive', []) + break else: raise LcmException("Not found vdu_id={} at vnfd:vdu".format(vdu_id)) vdur = db_vnfrs[vnf_index]["vdur"][vdu_index] @@ -1220,7 +1220,7 @@ class NsLcm(LcmBase): add_params["rw_mgmt_ip"] = vdur["ip-address"] else: add_params["rw_mgmt_ip"] = db_vnfrs[vnf_index]["ip-address"] - initial_config_primitive_list = vnfd["vnf-configuration"].get('initial-config-primitive', ()) + initial_config_primitive_list = vnfd["vnf-configuration"].get('initial-config-primitive', []) else: if db_nsr.get("additionalParamsForNs"): add_params = db_nsr["additionalParamsForNs"].copy() @@ -1235,14 +1235,17 @@ class NsLcm(LcmBase): initial_config_primitive_list.insert(1, {"name": "verify-ssh-credentials", "parameter": []}) for initial_config_primitive in initial_config_primitive_list: + primitive_params_ = self._map_primitive_params(initial_config_primitive, {}, add_params) + self.logger.debug(logging_text + step + " primitive '{}' params '{}'" + .format(initial_config_primitive["name"], primitive_params_)) primitive_result, primitive_detail = await self._ns_execute_primitive( db_nsr["_admin"]["deployed"], vnf_index, vdu_id, vdu_name, vdu_count_index, initial_config_primitive["name"], - self._map_primitive_params(initial_config_primitive, {}, add_params), + primitive_params_, retries=10 if initial_config_primitive["name"] == "verify-ssh-credentials" else 0, retries_interval=30) if primitive_result != "COMPLETED": - raise LcmException("charm error executing primitive {} for member_vnf_index={} vdu_id={}: '{}'" + raise LcmException("charm error executing primitive {} for member_vnf_index={} vdu_id={}: '{}'" .format(initial_config_primitive["name"], vca_deployed["member-vnf-index"], vca_deployed["vdu_id"], primitive_detail))