mirror of
https://gitlab.sectorq.eu/jaydee/portainer.git
synced 2025-12-14 18:44:53 +01:00
build
This commit is contained in:
4
port.py
4
port.py
@@ -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:
|
||||||
|
|||||||
@@ -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:
|
||||||
|
if action == "create_stack":
|
||||||
value_in.remove("pihole")
|
value_in.remove("pihole")
|
||||||
value_in.insert(0, "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(
|
||||||
|
|||||||
Reference in New Issue
Block a user