From: bravof Date: Thu, 22 Apr 2021 20:47:31 +0000 (-0400) Subject: Revert "Fixed bug 1476: VLD params (ip-profile) inside a NS not used" X-Git-Tag: v9.1.1^0 X-Git-Url: https://osm.etsi.org/gitweb/?a=commitdiff_plain;h=603f5f3284932cd6173e6ae00dffd833af7393e7;p=osm%2FLCM.git Revert "Fixed bug 1476: VLD params (ip-profile) inside a NS not used" This reverts commit 448d5e6c252e4ae13e3be69131e87be51740f850. Change-Id: I6bd038b03d2e7899df605724d09775897d90326d Signed-off-by: bravof --- diff --git a/osm_lcm/ns.py b/osm_lcm/ns.py index 3ba3645e..7f73c19d 100644 --- a/osm_lcm/ns.py +++ b/osm_lcm/ns.py @@ -664,25 +664,12 @@ class NsLcm(LcmBase): # check at nsd descriptor, if there is an ip-profile vld_params = {} - nsd_vlp = find_in_list( - get_virtual_link_profiles(nsd), - lambda a_link_profile: a_link_profile["virtual-link-desc-id"] == vld["id"]) - if nsd_vlp and nsd_vlp.get("virtual-link-protocol-data") and \ - nsd_vlp["virtual-link-protocol-data"].get("l3-protocol-data"): - ip_profile_source_data = nsd_vlp["virtual-link-protocol-data"]["l3-protocol-data"] - ip_profile_dest_data = {} - if "ip-version" in ip_profile_source_data: - ip_profile_dest_data["ip-version"] = ip_profile_source_data["ip-version"] - if "cidr" in ip_profile_source_data: - ip_profile_dest_data["subnet-address"] = ip_profile_source_data["cidr"] - if "gateway-ip" in ip_profile_source_data: - ip_profile_dest_data["gateway-address"] = ip_profile_source_data["gateway-ip"] - if "dhcp-enabled" in ip_profile_source_data: - ip_profile_dest_data["dhcp-params"] = { - "enabled": ip_profile_source_data["dhcp-enabled"] - } - vld_params["ip-profile"] = ip_profile_dest_data + virtual_link_profiles = get_virtual_link_profiles(nsd) + for vlp in virtual_link_profiles: + ip_profile = find_in_list(nsd["ip-profiles"], + lambda profile: profile["name"] == vlp["ip-profile-ref"]) + vld_params["ip-profile"] = ip_profile["ip-profile-params"] # update vld_params with instantiation params vld_instantiation_params = find_in_list(get_iterable(ns_params, "vld"), lambda a_vld: a_vld["name"] in (vld["name"], vld["id"]))