From ef063216dc27bb2317364d5a1c55da575d21611c Mon Sep 17 00:00:00 2001 From: Piotr Bartman-Szwarc Date: Sat, 29 Jun 2024 09:40:01 +0200 Subject: [PATCH] updater: update tests and manual --- doc/tools/qubes-vm-update.rst | 4 +++- vmupdate/tests/test_vmupdate.py | 5 +++-- vmupdate/vmupdate.py | 2 +- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/doc/tools/qubes-vm-update.rst b/doc/tools/qubes-vm-update.rst index ffc9d21..63971f7 100644 --- a/doc/tools/qubes-vm-update.rst +++ b/doc/tools/qubes-vm-update.rst @@ -61,6 +61,8 @@ Auxiliary Maximum number of VMs configured simultaneously (default: number of cpus) --log LOG Provide logging level. Values: DEBUG, INFO (default), WARNING, ERROR, CRITICAL +--signal-no-updates + Return exit code 100 instead of 0 if there is no updates available. --no-progress Do not show upgrading progress @@ -88,7 +90,7 @@ RETURN CODES 0: ok -100: ok, no updates available +100: ok, returned if `--signal-no-updates` and no updates available 1: general error diff --git a/vmupdate/tests/test_vmupdate.py b/vmupdate/tests/test_vmupdate.py index c3ba522..7cd8a36 100644 --- a/vmupdate/tests/test_vmupdate.py +++ b/vmupdate/tests/test_vmupdate.py @@ -408,8 +408,9 @@ def test_return_codes( monkeypatch.setattr(vmupdate, "get_targets", lambda *_: [vm, appvm]) - retcode = main(( - "--just-print-progress", "--all", "--force-update"), test_qapp) + retcode = main( + ("--just-print-progress", "--all", "--force-update", + "--signal-no-updates"), test_qapp) assert retcode == expected_retcode diff --git a/vmupdate/vmupdate.py b/vmupdate/vmupdate.py index 7b69115..053f70f 100644 --- a/vmupdate/vmupdate.py +++ b/vmupdate/vmupdate.py @@ -101,7 +101,7 @@ def parse_args(args, app): help='Just print what happens.') parser.add_argument( '--signal-no-updates', action='store_true', - help='Return exit code 100 instread of 0 ' + help='Return exit code 100 instead of 0 ' 'if there is no updates available.') restart = parser.add_mutually_exclusive_group()