From e059eb6f599b9aca229f8faa53793b15f2c06f1c Mon Sep 17 00:00:00 2001 From: garciadeblas Date: Tue, 24 Sep 2024 14:48:12 +0200 Subject: [PATCH] Fix copy of OKA package to PVC for OKA creation Change-Id: Ibf02828d969fe51749248a090dfbaab47a0d30e5 Signed-off-by: garciadeblas --- osm_lcm/odu_libs/oka.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/osm_lcm/odu_libs/oka.py b/osm_lcm/odu_libs/oka.py index 509733e..ff247ea 100644 --- a/osm_lcm/odu_libs/oka.py +++ b/osm_lcm/odu_libs/oka.py @@ -17,7 +17,6 @@ import yaml -from osm_lcm.lcm_utils import LcmException async def create_oka(self, op_id, op_params, content): @@ -37,16 +36,19 @@ async def create_oka(self, op_id, op_params, content): oka_folder = f"{oka_fs_info['path']}{oka_fs_info['folder']}" oka_filename = oka_fs_info["zipfile"] self.fs.sync(oka_folder) - if not self.fs.file_exists(f"{oka_folder}/{oka_filename}"): - raise LcmException(message="Not able to find oka", bad_args=["oka_path"]) + self.logger.info("OKA Folder: {} OKA filename: {}".format(oka_folder, oka_filename)) + # TODO: check if file exists + # if not self.fs.file_exists(f"{oka_folder}/{oka_filename}"): + # raise LcmException(message="Not able to find oka", bad_args=["oka_path"]) + self.logger.debug("Processing....") # Create temporary volume for the OKA package and copy the content temp_volume_name = f"temp-pvc-oka-{op_id}" await self._kubectl.create_pvc_with_content( name=temp_volume_name, namespace="osm-workflows", - src_folder=oka_folder, - filename=oka_filename, + src_file=f"{oka_folder}/{oka_filename}", + dest_filename=f"{oka_name}.tar.gz", ) # Render workflow -- 2.25.1