cleanup stdout

This commit is contained in:
Seth Foster 2021-04-14 15:07:18 -04:00
parent f98b92073d
commit 1c888ca58b
No known key found for this signature in database
GPG Key ID: 86E90D96F7184028

View File

@ -49,7 +49,10 @@ class Command(BaseCommand):
def cleanup_images(self):
self.images_in_use = [ee.image for ee in ExecutionEnvironment.objects.all()]
self.logger.info(f"Execution environment images in use: {self.images_in_use}")
if self.images_in_use:
self.logger.info("Execution environment images in use:")
for i in self.images_in_use:
self.logger.info(f"\t{i}")
self.deleted = []
# find and remove unused images
images_system = subprocess.run("podman images -a --format json".split(" "), capture_output=True)
@ -63,7 +66,7 @@ class Command(BaseCommand):
images_system = json.loads(images_system.stdout)
self.delete_images(images_system)
if not self.deleted:
self.logger.info("Did not find images to remove")
self.logger.info("Did not find unused images to remove")
def handle(self, *args, **options):
self.verbosity = int(options.get('verbosity', 1))