Compare commits

..

2 Commits

Author SHA1 Message Date
688cdb344d build 2025-12-07 13:40:10 +01:00
ee2e84fbdd build 2025-12-07 13:37:53 +01:00

12
port.py
View File

@@ -745,7 +745,8 @@ class Portainer:
print("Getting endpoint")
self.get_endpoint(endpoint_id)
if stack is not None:
self.get_stack(stack, endpoint_id)
for s in stack:
self.stack_ids = [self._resolve_stack_id(s, endpoint_id)]
for stck in self.stack_ids:
path = f"/stacks/{stck}/start"
if self.endpoint_id is not None:
@@ -766,15 +767,16 @@ class Portainer:
return True
def stop_stack(self, stack, endpoint_id):
"""Stop one stack or all stacks on an endpoint."""
print(f"Stopping stack {stack}")
if endpoint_id is not None:
self.get_endpoint(endpoint_id)
if stack == "all":
self.get_stack(stack, endpoint_id)
else:
if stack is not None:
self.stack_ids = [self._resolve_stack_id(stack, endpoint_id)]
for s in stack:
self.stack_ids = [self._resolve_stack_id(s, endpoint_id)]
# print(self.stack_ids)
for stck in self.stack_ids:
path = f"/stacks/{stck}/stop"