From 61b777dce30afc99523940a588494c1e0a307c27 Mon Sep 17 00:00:00 2001 From: usmannasir Date: Mon, 14 Apr 2025 22:43:50 +0500 Subject: [PATCH] bug fix: call function to install docker --- plogical/DockerSites.py | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/plogical/DockerSites.py b/plogical/DockerSites.py index 5a2c7ca4f..181d53855 100644 --- a/plogical/DockerSites.py +++ b/plogical/DockerSites.py @@ -720,12 +720,23 @@ services: for container in all_containers: logging.writeToFile(f'Container name: {container.name}') - # Now filter containers + # Now filter containers - handle both CentOS and Ubuntu naming containers = [] + + # Get both possible name formats + if ProcessUtilities.decideDistro() == ProcessUtilities.centos or ProcessUtilities.decideDistro() == ProcessUtilities.cent8: + search_name = self.DockerAppName # Already in hyphen format for CentOS + else: + # For Ubuntu, convert underscore to hyphen as containers use hyphens + search_name = self.DockerAppName.replace('_', '-') + + if os.path.exists(ProcessUtilities.debugPath): + logging.writeToFile(f'Searching for containers with name containing: {search_name}') + for container in all_containers: if os.path.exists(ProcessUtilities.debugPath): - logging.writeToFile(f'Checking container: {container.name} against filter: {self.DockerAppName}') - if self.DockerAppName.lower() in container.name.lower(): + logging.writeToFile(f'Checking container: {container.name} against filter: {search_name}') + if search_name.lower() in container.name.lower(): containers.append(container) if os.path.exists(ProcessUtilities.debugPath):