From 309aaed37efa050d589f0bdd30fcbd6d55a6c7d2 Mon Sep 17 00:00:00 2001 From: Kevin Veen-Birkenbach Date: Sat, 13 Jan 2024 16:52:36 +0100 Subject: [PATCH] Implemented storage optimizer for mongodb --- .../files/system-storage-optimizer.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/roles/system-storage-optimizer/files/system-storage-optimizer.py b/roles/system-storage-optimizer/files/system-storage-optimizer.py index 7012b975..9b5d32a9 100644 --- a/roles/system-storage-optimizer/files/system-storage-optimizer.py +++ b/roles/system-storage-optimizer/files/system-storage-optimizer.py @@ -25,8 +25,11 @@ def start_containers(containers): run_command(f"docker start {container_list}") def is_database(image): - databases = {"postgres", "mariadb", "redis", "memcached"} - return any(database in image for database in databases) + databases = {"postgres", "mariadb", "redis", "memcached", "mongo"} + # Split the string at the colon and take the first part + prefix = image.split(':')[0] + # Check if the prefix is in the database names + return prefix in databases def is_symbolic_link(file_path): return os.path.islink(file_path)