diff --git a/plogical/DockerSites.py b/plogical/DockerSites.py index 3eb4aabe9..9c4c7229e 100644 --- a/plogical/DockerSites.py +++ b/plogical/DockerSites.py @@ -546,8 +546,10 @@ def DeleteDockerApp(self): # Create a Docker client client = docker.from_env() + FilerValue = f"{self.data['name'].replace(' ', '')}_{self.data['name'].replace(' ', '-')}" + # Define the label to filter containers - label_filter = {'name': self.data['name'].replace(' ', '-')} + label_filter = {'name': FilerValue} # List containers matching the label filter containers = client.containers.list(filters=label_filter) @@ -578,8 +580,11 @@ def ListContainers(self): # Create a Docker client client = docker.from_env() + FilerValue = f"{self.data['name'].replace(' ', '')}_{self.data['name'].replace(' ', '-')}" + # Define the label to filter containers - label_filter = {'name': self.data['name'].replace(' ', '-')} + label_filter = {'name': FilerValue} + # List containers matching the label filter containers = client.containers.list(filters=label_filter) @@ -660,6 +665,10 @@ def ContainerInfo(self): logging.writeToFile("List Container ....... %s" % str(msg)) return 0, str(msg) + def RebuildApp(self): + self.DeleteDockerApp() + self.SubmitDockersiteCreation() + def Main(): try: