From 62e3e6c79fa1fb6254e1349a9351758665ea687f Mon Sep 17 00:00:00 2001 From: Willenst Date: Fri, 1 Nov 2024 17:42:18 +0200 Subject: [PATCH] Improve output --- manage_containers.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/manage_containers.py b/manage_containers.py index a20db5e..b35a8cd 100755 --- a/manage_containers.py +++ b/manage_containers.py @@ -76,7 +76,7 @@ def rm(self): subprocess.run(cmd, text=True, check=True) self.check() return '' - return '\n'.join(running) + return ''.join(running) def check(self): """Check whether the container exists and get its image ID""" @@ -100,7 +100,6 @@ def identify_runtime_cmd(self): cmd = ['docker', 'ps'] out = subprocess.run(cmd, text=True, check=False, capture_output=True) if out.returncode == 0: - print('We don\'t need "sudo" for working with containers') return ['docker'] if 'permission denied' in out.stderr: print('We need "sudo" for working with containers') @@ -131,7 +130,7 @@ def remove_containers(containers): for c in containers: if c.id: print(f'Removing Ubuntu-{c.ubuntu} container with GCC-{c.gcc} and Clang-{c.clang}') - out = out + c.rm() + out = out + '\n' + c.rm() if out: print('\nYou still have running containers, that can\'t be removed:\n'+out)