From 8362abfe4ab6629048dd1c1748780849dbe6291e Mon Sep 17 00:00:00 2001 From: d10s <79284025+D10S0VSkY-OSS@users.noreply.github.com> Date: Tue, 28 Nov 2023 23:56:10 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9Bfix:=20redis=20cache=20bad=20config?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sld-api-backend/src/worker/domain/services/command.py | 5 +++-- sld-api-backend/src/worker/providers/hashicorp/actions.py | 1 - 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/sld-api-backend/src/worker/domain/services/command.py b/sld-api-backend/src/worker/domain/services/command.py index ab33fac8..bedea757 100644 --- a/sld-api-backend/src/worker/domain/services/command.py +++ b/sld-api-backend/src/worker/domain/services/command.py @@ -1,8 +1,9 @@ import logging import subprocess import redis +from config.api import settings -redis_client = redis.Redis(host='localhost', port=6379, db=15) +redis_client = redis.Redis(host=settings.CACHE_SERVER, port=6379, db=15) def command(command: str, channel: str): @@ -48,4 +49,4 @@ def command(command: str, channel: str): logging.error( f"Error execute command code: {err.returncode}. Error:\n{err.stderr}" ) - return None + return err.returncode, err.stderr diff --git a/sld-api-backend/src/worker/providers/hashicorp/actions.py b/sld-api-backend/src/worker/providers/hashicorp/actions.py index f9e77ce5..14cf8d77 100644 --- a/sld-api-backend/src/worker/providers/hashicorp/actions.py +++ b/sld-api-backend/src/worker/providers/hashicorp/actions.py @@ -24,7 +24,6 @@ class Actions(StructBase): project_path: str task_id: str subprocess_handler: command = command - output = "" def execute_terraform_command(self, action: str) -> dict: channel = self.task_id