From 2c1c0a7a795f81794f5f6f20c2890799773c53c8 Mon Sep 17 00:00:00 2001 From: kjeld Schouten-Lebbing Date: Wed, 19 Jan 2022 20:46:10 +0100 Subject: [PATCH] move from active to all --- README.md | 1 + trueupdate/__init__.py | 12 ++++++------ 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index b4911b60..314a5f07 100644 --- a/README.md +++ b/README.md @@ -20,5 +20,6 @@ Additional options are available: - `trueupdate -h` for the CLI help page - `trueupdate -s` or ` trueupdate --sync` to sync the catalogs before running auto-update - `trueupdate -p` or ` trueupdate --prune` to prune (remove) old docker images after running auto-update +- `trueupdate -a` or ` trueupdate --all` updates both active (running) and non-active (stuck or stopped) Apps - `trueupdate --catalog CATALOGNAME` where CATALOGNAME is the name of the catalog you want to process in caps - `trueupdate --versioning SCHEME` where SCHEME is the highest semver version you want to process. options: `patch`, `minor` and `major` \ No newline at end of file diff --git a/trueupdate/__init__.py b/trueupdate/__init__.py index 014089a0..05cc4756 100644 --- a/trueupdate/__init__.py +++ b/trueupdate/__init__.py @@ -51,7 +51,7 @@ def check_semver(current: str, latest: str): def execute_upgrades(): - if ACTIVE: + if ALL: if CATALOG == "ALL": filtered = filter(lambda a: a.update_available and a.status == "active", INSTALLED_CHARTS) else: @@ -88,13 +88,13 @@ def process_args(): global VERSIONING global SYNC global PRUNE - global ACTIVE + global ALL parser = argparse.ArgumentParser(description='Update TrueNAS SCALE Apps') parser.add_argument('--catalog', nargs='?', default='ALL', help='name of the catalog you want to process in caps. Or "ALL" to render all catalogs.') parser.add_argument('--versioning', nargs='?', default='minor', help='Name of the versioning scheme you want to update. Options: major, minor or patch. Defaults to minor') parser.add_argument('-s', '--sync', action="store_true", help='sync catalogs before trying to update') parser.add_argument('-p', '--prune', action="store_true", help='prune old docker images after update') - parser.add_argument('-a', '--active', action="store_true", help='update "active" apps only and ignore "stopped" or "stuck" apps') + parser.add_argument('-a', '--all', action="store_true", help='update "active" apps only and ignore "stopped" or "stuck" apps') args = parser.parse_args() CATALOG = args.catalog VERSIONING = args.versioning @@ -106,10 +106,10 @@ def process_args(): PRUNE = True else: PRUNE = False - if args.active: - ACTIVE = True + if args.all: + ALL = True else: - ACTIVE = False + ALL = False def sync_catalog(): if SYNC: