From 35a9ae044de942dc985cbb9a5668eba21490a3cf Mon Sep 17 00:00:00 2001 From: Piotr Bartman-Szwarc Date: Mon, 10 Jun 2024 15:14:57 +0200 Subject: [PATCH] updater: make help prettier --- vmupdate/vmupdate.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/vmupdate/vmupdate.py b/vmupdate/vmupdate.py index c3b0b72..e46e768 100644 --- a/vmupdate/vmupdate.py +++ b/vmupdate/vmupdate.py @@ -116,7 +116,7 @@ def parse_args(args): 'Attempt to update targeted VMs with known updates available ' 'or for which last update check was more than N days ago. ' '(default: %(default)d)', - type=int, default=7, choices=range(0, 366)) + type=int, default=7) update_state.add_argument( '--update-if-available', action='store_true', help='Update targeted VMs with known updates available.') @@ -145,6 +145,9 @@ def parse_args(args): AgentArgs.add_arguments(parser) args = parser.parse_args(args) + if args.update_if_stale < 0: + raise ArgumentError("Wrong value for --update-if-stale") + return args