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 return True
def stop_stack(self, stack, endpoint_id): def stop_stack(self, stack, endpoint_id):
"""Stop one stack or all stacks on an endpoint.""" """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: if endpoint_id is not None:
self.get_endpoint(endpoint_id) self.get_endpoint(endpoint_id)
if stack is not None: if stack is not None:
for s in stack: for s in stack:
self.stack_ids.append(self._resolve_stack_id(s, endpoint_id)) 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: for stck in self.stack_ids:
path = f"/stacks/{stck}/stop" path = f"/stacks/{stck}/stop"
# print(path) # print(path)
@@ -1283,8 +1283,8 @@ class PortainerApi:
return "all" return "all"
if not self._is_number(stack): if not self._is_number(stack):
result = self.get_stack(stack, endpoint_id) result = self.stacks_all[endpoint_id]['by_name'][stack]
return result["Id"] return result
return int(stack) return int(stack)