Identified deadlocking funciton
This commit is contained in:
@@ -72,7 +72,7 @@ def run(
|
|||||||
)
|
)
|
||||||
|
|
||||||
stdout_buf, stderr_buf = handle_output(process, log)
|
stdout_buf, stderr_buf = handle_output(process, log)
|
||||||
|
# stdout_buf, stderr_buf = process.communicate()
|
||||||
# Wait for the subprocess to finish
|
# Wait for the subprocess to finish
|
||||||
rc = process.wait()
|
rc = process.wait()
|
||||||
cmd_out = CmdOut(
|
cmd_out = CmdOut(
|
||||||
|
|||||||
@@ -1,9 +1,11 @@
|
|||||||
import argparse
|
import argparse
|
||||||
import logging
|
import logging
|
||||||
import os
|
import os
|
||||||
|
import subprocess
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
from ..cmd import Log, run
|
from clan_cli.errors import ClanError
|
||||||
|
|
||||||
from ..machines.machines import Machine
|
from ..machines.machines import Machine
|
||||||
|
|
||||||
log = logging.getLogger(__name__)
|
log = logging.getLogger(__name__)
|
||||||
@@ -15,13 +17,14 @@ def generate_secrets(machine: Machine) -> None:
|
|||||||
env["PYTHONPATH"] = ":".join(sys.path) # TODO do this in the clanCore module
|
env["PYTHONPATH"] = ":".join(sys.path) # TODO do this in the clanCore module
|
||||||
|
|
||||||
print(f"generating secrets... {machine.generate_secrets}")
|
print(f"generating secrets... {machine.generate_secrets}")
|
||||||
run(
|
proc = subprocess.run(
|
||||||
[machine.generate_secrets],
|
[machine.generate_secrets],
|
||||||
env=env,
|
env=env,
|
||||||
error_msg="failed to generate secrets",
|
|
||||||
log=Log.BOTH,
|
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if proc.returncode != 0:
|
||||||
|
raise ClanError("failed to generate secrets")
|
||||||
|
else:
|
||||||
print("successfully generated secrets")
|
print("successfully generated secrets")
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user