Skip to content

Commit

Permalink
bug fix: recreate app
Browse files Browse the repository at this point in the history
  • Loading branch information
usmannasir committed Dec 25, 2023
1 parent 55a0e3a commit 39c7b2d
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions plogical/DockerSites.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit 39c7b2d

Please sign in to comment.