diff --git a/backend/SC4SNMP_UI_backend/__init__.py b/backend/SC4SNMP_UI_backend/__init__.py index 95b3143..3276693 100644 --- a/backend/SC4SNMP_UI_backend/__init__.py +++ b/backend/SC4SNMP_UI_backend/__init__.py @@ -15,6 +15,7 @@ CELERY_BROKER_URL = os.getenv("CELERY_BROKER_URL", "amqp://guest:guest@localhost:5672//") REDIS_URL = os.getenv("REDIS_URL") VALUES_DIRECTORY = os.getenv("VALUES_DIRECTORY", "") +KEEP_TEMP_FILES = os.getenv("KEEP_TEMP_FILES", "false") class NoValuesDirectoryException(Exception): pass diff --git a/backend/SC4SNMP_UI_backend/apply_changes/handling_chain.py b/backend/SC4SNMP_UI_backend/apply_changes/handling_chain.py index 7fad688..fd8e51a 100644 --- a/backend/SC4SNMP_UI_backend/apply_changes/handling_chain.py +++ b/backend/SC4SNMP_UI_backend/apply_changes/handling_chain.py @@ -81,7 +81,7 @@ def handle(self, request: dict): for key, value in request["yaml_sections"].items(): tmp_file_name = TMP_FILE_PREFIX + key.replace(".", "_") + ".yaml" - directory = VALUES_DIRECTORY if not values_file_resolved else TMP_DIR + directory = VALUES_DIRECTORY if not delete_temp_files else TMP_DIR tmp_file_path = os.path.join(directory, tmp_file_name) mongo_collection = value[0]