Move assert after logs output to make debug easier

This commit is contained in:
Ayaz Salikhov
2021-06-27 13:19:05 +03:00
parent aee3cbba77
commit 5c860df8c4
10 changed files with 11 additions and 11 deletions

View File

@@ -32,8 +32,8 @@ class DockerRunner:
def run_simple_command(container, cmd: str, print_result: bool = 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").rstrip()
if print_result:
logger.info(f"Command result: {result}")
assert out.exit_code == 0, f"Command: {cmd} failed"
return result