This commit is contained in:
2025-12-05 12:33:59 +01:00
parent bc64e5d023
commit aba67dc90d
2 changed files with 10 additions and 5 deletions

View File

@@ -840,9 +840,9 @@ class Portainer:
def _delete_single_stack(self, stack_id, endpoint_id): def _delete_single_stack(self, stack_id, endpoint_id):
path = f"/stacks/{stack_id}?endpointId={endpoint_id}&removeVolumes=true" path = f"/stacks/{stack_id}?endpointId={endpoint_id}&removeVolumes=true"
# print(path)
try: try:
out = self._api_delete(path) out = self._api_delete(path,timeout=240)
except ValueError as e: except ValueError as e:
msg = str(e) msg = str(e)
if "Conflict for url" in msg: if "Conflict for url" in msg:

View File

@@ -212,7 +212,7 @@ def wl(msg):
print(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")] fields = [("arg_name", "Prompt text")]
""" """
@@ -284,8 +284,12 @@ def prompt_missing_args(args_in, defaults_in, fields):
# User selected "Select ALL" # User selected "Select ALL"
value_in = commands # all real commands value_in = commands # all real commands
if "pihole" in value_in: if "pihole" in value_in:
value_in.remove("pihole") if action == "create_stack":
value_in.insert(0, "pihole") 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)) print(" >> Stacks :", ",".join(value_in))
else: else:
value_in = ( value_in = (
@@ -419,6 +423,7 @@ if __name__ == "__main__":
("endpoint_id", "Endpoint ID"), ("endpoint_id", "Endpoint ID"),
("stack", "Stack name or ID"), ("stack", "Stack name or ID"),
], ],
action="delete_stack",
) )
input( input(