bug fix: call function to install docker

This commit is contained in:
usmannasir 2025-04-14 22:43:50 +05:00
parent 18b2c6d70d
commit 61b777dce3
1 changed files with 14 additions and 3 deletions

View File

@ -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):