diff --git a/main.py b/main.py index 8c53776..e8ab229 100755 --- a/main.py +++ b/main.py @@ -268,7 +268,11 @@ def prompt_missing_args(args_in, defaults_in, fields, action=None,stacks=None): print(por.all_data['stacks'][defaults_in[f"PORTAINER_ENDPOINT_ID".upper()]]['by_name'].keys()) for s in por.all_data['stacks'][defaults_in[f"PORTAINER_ENDPOINT_ID".upper()]]['by_name'].keys(): #print(s) - commands.remove(s) + try: + commands.remove(s) + except ValueError as e: + print(e) + except KeyError: print("No stacks found for endpoint", defaults_in[f"PORTAINER_ENDPOINT_ID".upper()])