From aba67dc90d4ca280164f7f0f2a386ed0d55586ed Mon Sep 17 00:00:00 2001 From: jaydee Date: Fri, 5 Dec 2025 12:33:59 +0100 Subject: [PATCH] build --- port.py | 4 ++-- portainer.py | 11 ++++++++--- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/port.py b/port.py index 74fb21e..3f1d327 100644 --- a/port.py +++ b/port.py @@ -840,9 +840,9 @@ class Portainer: def _delete_single_stack(self, stack_id, endpoint_id): path = f"/stacks/{stack_id}?endpointId={endpoint_id}&removeVolumes=true" - + # print(path) try: - out = self._api_delete(path) + out = self._api_delete(path,timeout=240) except ValueError as e: msg = str(e) if "Conflict for url" in msg: diff --git a/portainer.py b/portainer.py index 41fbda1..d137bea 100755 --- a/portainer.py +++ b/portainer.py @@ -212,7 +212,7 @@ def wl(msg): print(msg) -def prompt_missing_args(args_in, defaults_in, fields): +def prompt_missing_args(args_in, defaults_in, fields, action=None): """ fields = [("arg_name", "Prompt text")] """ @@ -284,8 +284,12 @@ def prompt_missing_args(args_in, defaults_in, fields): # User selected "Select ALL" value_in = commands # all real commands if "pihole" in value_in: - value_in.remove("pihole") - value_in.insert(0, "pihole") + if action == "create_stack": + value_in.remove("pihole") + value_in.insert(0, "pihole") + elif action == "delete_stack": + value_in.remove("pihole") + value_in.append("pihole") print(" >> Stacks :", ",".join(value_in)) else: value_in = ( @@ -419,6 +423,7 @@ if __name__ == "__main__": ("endpoint_id", "Endpoint ID"), ("stack", "Stack name or ID"), ], + action="delete_stack", ) input(