From: kayal2001 Date: Mon, 6 Nov 2023 09:15:51 +0000 (+0000) Subject: Fix Bug 2303:NS instance name getting truncated in OpenStack X-Git-Tag: release-v16.0-start~7 X-Git-Url: https://osm.etsi.org/gitweb/?a=commitdiff_plain;h=29712418a90f80aee5042bb605f1c4c394a92c6a;p=osm%2FRO.git Fix Bug 2303:NS instance name getting truncated in OpenStack Change-Id: Ifcd11c79289d8b792c944f8cb0de46e6d967dc04 Signed-off-by: kayal2001 Signed-off-by: garciadeblas --- diff --git a/NG-RO/osm_ng_ro/ns.py b/NG-RO/osm_ng_ro/ns.py index 317579be..c71e1134 100644 --- a/NG-RO/osm_ng_ro/ns.py +++ b/NG-RO/osm_ng_ro/ns.py @@ -1837,9 +1837,9 @@ class Ns(object): extra_dict["params"] = { "name": "{}-{}-{}-{}".format( - indata["name"][:16], - vnfr["member-vnf-index-ref"][:16], - target_vdu["vdu-name"][:32], + indata["name"], + vnfr["member-vnf-index-ref"], + target_vdu["vdu-name"], target_vdu.get("count-index") or 0, ), "description": target_vdu["vdu-name"], @@ -2070,9 +2070,9 @@ class Ns(object): extra_dict["params"] = { "name": "{}-{}-{}-{}".format( - db_nsr["name"][:16], - vnfr["member-vnf-index-ref"][:16], - existing_vdu["vdu-name"][:32], + db_nsr["name"], + vnfr["member-vnf-index-ref"], + existing_vdu["vdu-name"], existing_vdu.get("count-index") or 0, ), "description": existing_vdu["vdu-name"], diff --git a/NG-RO/osm_ng_ro/tests/test_ns.py b/NG-RO/osm_ng_ro/tests/test_ns.py index 0da52903..2288a605 100644 --- a/NG-RO/osm_ng_ro/tests/test_ns.py +++ b/NG-RO/osm_ng_ro/tests/test_ns.py @@ -181,7 +181,7 @@ expected_extra_dict = { "disk_list": [], "flavor_id": f"TASK-{ns_preffix}:flavor.0", "image_id": f"TASK-{ns_preffix}:image.0", - "name": "sample_name-vnf-several-volu-several_volumes-VM-0", + "name": "sample_name-vnf-several-volumes-several_volumes-VM-0", "net_list": [], "start": True, }, @@ -201,7 +201,7 @@ expected_extra_dict2 = { "disk_list": [], "flavor_id": f"TASK-{ns_preffix}:flavor.0", "image_id": f"TASK-{ns_preffix}:image.0", - "name": "sample_name-vnf-several-volu-without_volumes-VM-0", + "name": "sample_name-vnf-several-volumes-without_volumes-VM-0", "net_list": [], "start": True, },