Skip to content

Commit

Permalink
fix for tendermint PATH env vars
Browse files Browse the repository at this point in the history
  • Loading branch information
solarw committed Sep 5, 2024
1 parent 4a0d4d7 commit fd212a7
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions operate/services/deployment_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -227,12 +227,13 @@ def _start_agent(self) -> None:
"""Start agent process."""
working_dir = self._work_directory
env = json.loads((working_dir / "agent.json").read_text(encoding="utf-8"))
env = {**os.environ, **env}
process = subprocess.Popen( # pylint: disable=consider-using-with # nosec
args=[self._aea_bin, "run"],
cwd=working_dir / "agent",
stdout=subprocess.DEVNULL,
stderr=subprocess.DEVNULL,
env={**os.environ, **env},
env=env,
creationflags=(
0x00000200 if platform.system() == "Windows" else 0
), # Detach process from the main process
Expand All @@ -246,17 +247,22 @@ def _start_tendermint(self) -> None:
"""Start tendermint process."""
working_dir = self._work_directory
env = json.loads((working_dir / "tendermint.json").read_text(encoding="utf-8"))
env = {
**os.environ,
**env,
}

if platform.system() == "Windows":
# to look up for bundled in tendermint.exe
env["PATH"] = os.environ["PATH"] + ";" + os.path.dirname(sys.executable)

tendermint_com = self._tendermint_bin # type: ignore # pylint: disable=protected-access
process = subprocess.Popen( # pylint: disable=consider-using-with # nosec
args=[tendermint_com],
cwd=working_dir,
stdout=subprocess.DEVNULL,
stderr=subprocess.DEVNULL,
env={
**os.environ,
**env,
"PATH": os.environ["PATH"] + ";" + os.path.dirname(sys.executable),
},
env=env,
creationflags=(
0x00000200 if platform.system() == "Windows" else 0
), # Detach process from the main process
Expand Down

0 comments on commit fd212a7

Please sign in to comment.