X-Git-Url: https://osm.etsi.org/gitweb/?a=blobdiff_plain;f=NG-RO%2Fosm_ng_ro%2Fns.py;h=a555672569fa3067266f9a4115f49acc1789697b;hb=01619d5b596e01ac8cd6d27bf01a1174e6b3f97b;hp=4e88cc4b976f60c1314ea269c93d78cf5f097ad2;hpb=21c55d66c67cce097adab2f237356388b1a16077;p=osm%2FRO.git diff --git a/NG-RO/osm_ng_ro/ns.py b/NG-RO/osm_ng_ro/ns.py index 4e88cc4b..a5556725 100644 --- a/NG-RO/osm_ng_ro/ns.py +++ b/NG-RO/osm_ng_ro/ns.py @@ -862,44 +862,6 @@ class Ns(object): return extra_dict - @staticmethod - def _ip_profile_to_ro( - ip_profile: Dict[str, Any], - ) -> Dict[str, Any]: - """[summary] - - Args: - ip_profile (Dict[str, Any]): [description] - - Returns: - Dict[str, Any]: [description] - """ - if not ip_profile: - return None - - ro_ip_profile = { - "ip_version": "IPv4" - if "v4" in ip_profile.get("ip-version", "ipv4") - else "IPv6", - "subnet_address": ip_profile.get("subnet-address"), - "gateway_address": ip_profile.get("gateway-address"), - "dhcp_enabled": ip_profile.get("dhcp-params", {}).get("enabled", False), - "dhcp_start_address": ip_profile.get("dhcp-params", {}).get( - "start-address", None - ), - "dhcp_count": ip_profile.get("dhcp-params", {}).get("count", None), - } - - if ip_profile.get("dns-server"): - ro_ip_profile["dns_address"] = ";".join( - [v["address"] for v in ip_profile["dns-server"] if v.get("address")] - ) - - if ip_profile.get("security-group"): - ro_ip_profile["security_group"] = ip_profile["security-group"] - - return ro_ip_profile - @staticmethod def _process_net_params( target_vld: Dict[str, Any], @@ -963,7 +925,7 @@ class Ns(object): "net_name": ( f"{indata.get('name')[:16]}-{target_vld.get('name', target_vld.get('id'))[:16]}" ), - "ip_profile": Ns._ip_profile_to_ro(vim_info.get("ip_profile")), + "ip_profile": vim_info.get("ip_profile"), "provider_network_profile": vim_info.get("provider_network"), }