Skip to content

Commit

Permalink
feat: add color on ansible logs
Browse files Browse the repository at this point in the history
Add ANSIBLE_FORCE_COLOR environment variable to the ansible subprocess.
  • Loading branch information
PaulFarault committed Nov 9, 2023
1 parent 19b9ca2 commit e1f94c6
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions tdp/core/deployment/executor.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

import io
import logging
import os
import shutil
import subprocess
from collections.abc import Iterable
Expand Down Expand Up @@ -46,6 +47,7 @@ def _execute_ansible_command(
stderr=subprocess.STDOUT,
cwd=self._rundir,
universal_newlines=True,
env=os.environ | {"ANSIBLE_FORCE_COLOR": "true"},
)
if res.stdout is None:
raise Exception("Process has not stdout")
Expand Down

0 comments on commit e1f94c6

Please sign in to comment.