mirror of
https://github.com/jupyter/docker-stacks.git
synced 2025-10-08 10:34:06 +00:00
Improve logs
This commit is contained in:
@@ -29,10 +29,11 @@ class DockerRunner:
|
||||
logger.info(f"Container {self.container.name} removed")
|
||||
|
||||
|
||||
def run_simple_command(container, cmd):
|
||||
def run_simple_command(container, cmd, print_result=True):
|
||||
logger.info(f"Running cmd: '{cmd}' on container: {container}")
|
||||
out = container.exec_run(cmd)
|
||||
assert out.exit_code == 0, f"Command: {cmd} failed"
|
||||
result = out.output.decode("utf-8").strip()
|
||||
logger.info(f"Command result: {result}")
|
||||
if print_result:
|
||||
logger.info(f"Command result: {result}")
|
||||
return result
|
||||
|
Reference in New Issue
Block a user