mirror of
https://gitlab.sectorq.eu/jaydee/portainer.git
synced 2026-05-04 13:59:51 +02:00
build
This commit is contained in:
+4
-5
@@ -1236,15 +1236,14 @@ class PortainerApi:
|
||||
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 +1282,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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user