From: aticig Date: Mon, 30 May 2022 17:45:55 +0000 (+0300) Subject: Use revision number for updated vnfd X-Git-Tag: v12.0.0rc1~8 X-Git-Url: https://osm.etsi.org/gitweb/?a=commitdiff_plain;h=d708354a4c899a118bc68a93caf8b22aabd2e723;p=osm%2FLCM.git Use revision number for updated vnfd This patch fixes the Robot Basic 25 after NBI patch 12071. Change-Id: Iec98a7b9b61f2c8f59fafaacaf586669b1eaa10d Signed-off-by: aticig --- diff --git a/osm_lcm/lcm_utils.py b/osm_lcm/lcm_utils.py index 4ec9d49..1854da7 100644 --- a/osm_lcm/lcm_utils.py +++ b/osm_lcm/lcm_utils.py @@ -118,7 +118,7 @@ def get_charm_artifact_path(base_folder, charm_name, charm_type, revision=str()) if base_folder.get("pkg-dir"): artifact_path = "{}/{}/{}/{}".format( - base_folder["folder"] + extension, + base_folder["folder"].split(":")[0] + extension, base_folder["pkg-dir"], "charms" if charm_type in ("native_charm", "lxc_proxy_charm", "k8s_proxy_charm") @@ -129,7 +129,7 @@ def get_charm_artifact_path(base_folder, charm_name, charm_type, revision=str()) else: # For SOL004 packages artifact_path = "{}/Scripts/{}/{}".format( - base_folder["folder"] + extension, + base_folder["folder"].split(":")[0] + extension, "charms" if charm_type in ("native_charm", "lxc_proxy_charm", "k8s_proxy_charm") else "helm-charts", diff --git a/osm_lcm/ns.py b/osm_lcm/ns.py index afd3828..02b9f08 100644 --- a/osm_lcm/ns.py +++ b/osm_lcm/ns.py @@ -5685,7 +5685,7 @@ class NsLcm(LcmBase): # There is new revision of VNFD, update operation is required current_vnfd_path = vnfd_id + ":" + str(current_vnf_revision) - latest_vnfd_path = vnfd_id + latest_vnfd_path = vnfd_id + ":" + str(latest_vnfd_revision) step = "Removing the VNFD packages if they exist in the local path" shutil.rmtree(self.fs.path + current_vnfd_path, ignore_errors=True) @@ -5746,6 +5746,7 @@ class NsLcm(LcmBase): base_folder, charm_name, charm_type, + latest_vnfd_revision, ) ) diff --git a/osm_lcm/tests/test_ns.py b/osm_lcm/tests/test_ns.py index 7613a88..4234562 100644 --- a/osm_lcm/tests/test_ns.py +++ b/osm_lcm/tests/test_ns.py @@ -981,7 +981,7 @@ class TestMyNS(asynctest.TestCase): mock_charm_hash.assert_called_with( "7637bcf8-cf14-42dc-ad70-c66fcf1e6e77:1/hackfest_3charmed_vnfd/charms/simple", - "7637bcf8-cf14-42dc-ad70-c66fcf1e6e77/hackfest_3charmed_vnfd/charms/simple", + "7637bcf8-cf14-42dc-ad70-c66fcf1e6e77:3/hackfest_3charmed_vnfd/charms/simple", ) self.assertEqual(fs.sync.call_count, 2) @@ -1151,7 +1151,7 @@ class TestMyNS(asynctest.TestCase): mock_charm_hash.assert_called_with( "7637bcf8-cf14-42dc-ad70-c66fcf1e6e77:1/hackfest_3charmed_vnfd/charms/simple", - "7637bcf8-cf14-42dc-ad70-c66fcf1e6e77/hackfest_3charmed_vnfd/charms/simple", + "7637bcf8-cf14-42dc-ad70-c66fcf1e6e77:3/hackfest_3charmed_vnfd/charms/simple", ) self.assertEqual(fs.sync.call_count, 2)