Исправлен вывод команд

This commit is contained in:
Ярослав Малинин 2026-05-06 19:20:51 +03:00
parent f87051e35b
commit 419400c9a2
3 changed files with 195 additions and 5 deletions

View file

@ -53,7 +53,7 @@ def execute_shell(
logger.debug(f"Execution parameters: timeout={effective_timeout}s, cwd='{cwd}'")
try:
logger.info(f"Executing command in workspace '{cwd}'")
logger.info(f"Executing command '{command}' in workspace '{cwd}'")
result = subprocess.run(
command,
shell=True,
@ -85,15 +85,15 @@ def execute_shell(
output += f"\n\n[Command {status} with exit code {result.returncode}]"
if result.returncode == 0:
logger.info(f"Command succeeded. Exiting execute_shell function")
logger.info(f"Command '{command}' succeeded. Exiting execute_shell function")
else:
logger.warning(f"Command failed with exit code {result.returncode}")
logger.warning(f"Command '{command}' failed with exit code {result.returncode}")
return output
except subprocess.TimeoutExpired:
logger.warning(f"Command timed out after {effective_timeout} seconds")
return f"Error: Command timed out after {effective_timeout} seconds"
logger.warning(f"Command '{command}' timed out after {effective_timeout} seconds")
return f"Error: Command '{command}' timed out after {effective_timeout} seconds"
except FileNotFoundError:
logger.warning(f"Command not found: '{command}'")
return f"Error: Command not found"