From 98af4c223f61a900d673f7c9ff98c6ba82cca7ae Mon Sep 17 00:00:00 2001
From: Debora Benedetto <debora.benedetto@hpecds.com>
Date: Thu, 7 Apr 2022 15:18:16 +0200
Subject: [PATCH] bugfix in CompressFolder class

---
 api/InfrastructureTemplateController.py | 3 +--
 controller/Orchestrator.py              | 4 ++--
 2 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/api/InfrastructureTemplateController.py b/api/InfrastructureTemplateController.py
index a40c56d..e944261 100644
--- a/api/InfrastructureTemplateController.py
+++ b/api/InfrastructureTemplateController.py
@@ -21,6 +21,5 @@ def create_iac_from_doml(data: str = Body(..., media_type="application/xml")):
     logging.info("Received create_iac_from_doml request")
     compress_folder_info = Orchestrator.create_iac_from_doml(model=data, metamodel_directory="icgparser/doml",
                                                              is_multiecore_metamodel=False)
-    logging.info(f"file_path: {compress_folder_info.file_path}, filename: {compress_folder_info.filename}")
-    return FileResponse(path=compress_folder_info.filename, media_type='application/octet-stream', ## TODO change path into compress_folder_info.file_path
+    return FileResponse(path=compress_folder_info.file_path, media_type='application/octet-stream',
                         filename=compress_folder_info.filename)
diff --git a/controller/Orchestrator.py b/controller/Orchestrator.py
index cea3b02..0713909 100644
--- a/controller/Orchestrator.py
+++ b/controller/Orchestrator.py
@@ -8,9 +8,10 @@ from plugin import AnsiblePlugin, TerraformPlugin
 
 class CompressFolder:
     def __init__(self, file_path, filename):
-        self.file_path = file_path,
+        self.file_path = file_path
         self.filename = filename
 
+
 def create_infrastructure_files(intermediate_representation: dict):
     template_generated_folder = intermediate_representation["output_path"]
     choose_plugin(intermediate_representation, template_generated_folder)
@@ -98,7 +99,6 @@ def compress_iac_folder(template_generated_folder):
     compress_file_folder_path = compress_file(template_generated_folder, compress_file_name)
     logging.info(f"Successfully created iac files, available at {compress_file_folder_path}")
     compress_folder_info = CompressFolder(file_path=compress_file_folder_path, filename=compress_file_name)
-    logging.info(f"######################### {compress_folder_info.file_path}") ## TODO fix, is tuple instead of string
     return compress_folder_info
 
 def create_iac_from_intermediate_representation(intermediate_representation):
-- 
GitLab