Compare commits

...

2 Commits

Author SHA1 Message Date
jaydee 9986c1bc03 build 2026-03-20 22:11:03 +01:00
jaydee 18afddee86 build 2026-03-20 20:57:15 +01:00
+5 -5
View File
@@ -1233,18 +1233,18 @@ class PortainerApi:
)
return True
def stop_stack(self, stack, endpoint_id):
"""Stop one stack or all stacks on an endpoint."""
print(f"Stopping stack {stack}")
# print(f"Stopping stack {stack}")
if endpoint_id is not None:
self.get_endpoint(endpoint_id)
if stack is not None:
for s in stack:
self.stack_ids.append(self._resolve_stack_id(s, endpoint_id))
# print(self.stack_ids)
self.stack_ids = list(dict.fromkeys(self.stack_ids))
for stck in self.stack_ids:
path = f"/stacks/{stck}/stop"
# print(path)
@@ -1283,8 +1283,8 @@ class PortainerApi:
return "all"
if not self._is_number(stack):
result = self.get_stack(stack, endpoint_id)
return result["Id"]
result = self.stacks_all[endpoint_id]['by_name'][stack]
return result
return int(stack)