Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 22 additions & 1 deletion vmupdate/vmupdate.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,10 @@ def main(args=None, app=qubesadmin.Qubes()):

if not targets:
if not args.quiet:
print("No qube selected for update")
print(
"No qube eligible for update. Try --force-update to ensure ",
"all qubes are checked for new updates.",
)
return EXIT.OK_NO_UPDATES if args.signal_no_updates else EXIT.OK

admin = [target for target in targets if target.klass == "AdminVM"]
Expand Down Expand Up @@ -336,6 +339,11 @@ def select_targets(targets, args) -> Set[qubesadmin.vm.QubesVM]:
skip_update = False

if skip_update or prohibit_start:
if not args.quiet:
print(
"Skipped {}. Marked to skip updates or start prohibited",
vm.name,
)
continue

# there are updates available => select
Expand All @@ -346,10 +354,23 @@ def select_targets(targets, args) -> Set[qubesadmin.vm.QubesVM]:
# update vm only if there are updates available
# and that's not true at this point => skip
if args.update_if_available:
if not args.quiet:
print(
"Skipped {}. No updates available or not recently ",
"checked for updates.",
vm.name,
)
continue

if is_stale(vm, expiration_period=args.update_if_stale):
selected.add(vm)
else:
if not args.quiet:
print(
"Skipped {}. No updates available or last check still ",
"within stale period.",
vm.name,
)

return selected

Expand Down