From 9c6445ee0396c3e9283cdbd9f61cd259260ff8b7 Mon Sep 17 00:00:00 2001 From: jaydee Date: Fri, 19 Dec 2025 17:08:15 +0100 Subject: [PATCH] build --- port.py | 8 ++++---- portainer.py | 10 +++++----- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/port.py b/port.py index 2b50f4e..acd1654 100644 --- a/port.py +++ b/port.py @@ -834,7 +834,7 @@ class Portainer: } self._api_post_file(path, self.endpoint_id, stack, envs, file) - def print_stacks(self, endpoint="all"): + def print_stacks(self, args): """Print a table of stacks, optionally filtered by endpoint.""" stacks = self.get_stacks() count = 0 @@ -842,11 +842,11 @@ class Portainer: stack_names = [] for stack in stacks: # print(stack) - if endpoint is not None: + if args.endpoint_id is not None: if not stack["EndpointId"] in self.endpoints["by_id"]: continue - if endpoint != "all": - if self.endpoints["by_name"][endpoint] != stack["EndpointId"]: + if args.endpoint_id != "all": + if self.endpoints["by_name"][args.endpoint_id] != stack["EndpointId"]: continue try: stack_names.append(stack["Name"]) diff --git a/portainer.py b/portainer.py index 54d7d64..4a8fa20 100755 --- a/portainer.py +++ b/portainer.py @@ -83,10 +83,6 @@ def load_config(defaults=defaults): print("Configuration written to /myapps/portainer.conf") return cur_config - - - - a = load_config(defaults) # ENV_VARS = [ @@ -109,7 +105,11 @@ def update_configs(cur_config): print("Configuration written to /myapps/portainer.conf") parser = argparse.ArgumentParser( - description="Portainer helper - use env vars or pass credentials." + description=f"""\ +Portainer helper - use env vars or pass credentials." +version: {VERSION} + """, + formatter_class=argparse.RawTextHelpFormatter, ) parser.add_argument( "--base",