Use revision number for updated vnfd 41/12141/3
authoraticig <gulsum.atici@canonical.com>
Mon, 30 May 2022 17:45:55 +0000 (20:45 +0300)
committerbeierlm <mark.beierl@canonical.com>
Tue, 31 May 2022 16:06:03 +0000 (18:06 +0200)
This patch fixes the Robot Basic 25 after NBI patch 12071.

Change-Id: Iec98a7b9b61f2c8f59fafaacaf586669b1eaa10d
Signed-off-by: aticig <gulsum.atici@canonical.com>
osm_lcm/lcm_utils.py
osm_lcm/ns.py
osm_lcm/tests/test_ns.py

index 4ec9d49..1854da7 100644 (file)
@@ -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",
index afd3828..02b9f08 100644 (file)
@@ -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,
                                         )
                                     )
 
index 7613a88..4234562 100644 (file)
@@ -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)