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