This commit is contained in:
2025-11-21 14:07:41 +01:00
parent 23b91f95b1
commit 9ea80b2132

View File

@@ -13,10 +13,6 @@ import logging
parser = argparse.ArgumentParser(description="Portainer helper - use env vars or pass credentials.")
parser.add_argument("--base", "-b", default=os.getenv("PORTAINER_URL", "https://portainer.example.com"),
help="Base URL for Portainer (ENV: PORTAINER_URL)")
parser.add_argument("--user", "-u", default=os.getenv("PORTAINER_USER"),
help="Portainer username (ENV: PORTAINER_USER)")
parser.add_argument("--password", "-p", default=os.getenv("PORTAINER_PASS"),
help="Portainer password (ENV: PORTAINER_PASS)")
parser.add_argument("--endpoint-id", "-e", type=str, default="all", help="Endpoint ID to limit stack operations")
parser.add_argument("--refresh-environment", "-R", action="store_true", help="List endpoints")
parser.add_argument("--list-endpoints","-E", action="store_true", help="List endpoints")
@@ -184,10 +180,10 @@ if __name__ == "__main__":
sys.exit()
if args.refresh_status:
if args.stack_id == "all":
if args.stack== "all":
print("Stopping all stacks...")
stcks = get_stacks(base, token, endpoint_id=install_endpoint_id)
stcks = por.get_stacks(base, token, endpoint_id=args.endpoint_id)
# stcks = get_stack(base, sta, token, endpoint_id=install_endpoint_id)
else:
refresh_status(base, args.stack_id, token)
por.refresh_status(base, args.stack_id, token)