Compare commits

...

2 Commits

Author SHA1 Message Date
b65680be59 build 2025-11-22 09:21:37 +01:00
ladislav.dusa
a62f26e432 build 2025-11-22 08:50:11 +01:00
2 changed files with 7 additions and 4 deletions

View File

@@ -576,9 +576,9 @@ class Portainer:
print(f"Error stoping stack: {e}") print(f"Error stoping stack: {e}")
return [] return []
if "Id" in json.loads(resp): if "Id" in json.loads(resp):
print(f"Stack {self.stacks_all[self.endpoint_id]["by_id"][stack]} : started") print(f"Stack {self.stacks_all[self.endpoint_id]['by_id'][stack]} : started")
else: else:
print(f"Stack {self.stacks_all[self.endpoint_id]["by_id"][stack]} : {json.loads(resp)['message']}") print(f"Stack {self.stacks_all[self.endpoint_id]['by_id'][stack]} : {json.loads(resp)['message']}")
return True return True
def stop_stack(self,stack,endpoint_id): def stop_stack(self,stack,endpoint_id):
print(f"Stopping stack {stack}") print(f"Stopping stack {stack}")
@@ -599,9 +599,9 @@ class Portainer:
print(f"Error stoping stack: {e}") print(f"Error stoping stack: {e}")
return [] return []
if "Id" in json.loads(resp): if "Id" in json.loads(resp):
print(f"Stack {self.stacks_all[self.endpoint_id]["by_id"][stack]} : stopped") print(f"Stack {self.stacks_all[self.endpoint_id]['by_id'][stack]} : stopped")
else: else:
print(f"Stack {self.stacks_all[self.endpoint_id]["by_id"][stack]} : {json.loads(resp)['message']}") print(f"Stack {self.stacks_all[self.endpoint_id]['by_id'][stack]} : {json.loads(resp)['message']}")
return True return True
def delete_stack(self, endpoint_id=None, stack=None, timeout=None): def delete_stack(self, endpoint_id=None, stack=None, timeout=None):

3
requirements.txt Normal file
View File

@@ -0,0 +1,3 @@
requests
gitpython
tabulate