diff --git a/vmupdate/update_manager.py b/vmupdate/update_manager.py index bb01795..7a90a1d 100644 --- a/vmupdate/update_manager.py +++ b/vmupdate/update_manager.py @@ -94,6 +94,8 @@ def run(self, agent_args): self.log.info("Update Manager: Finished, collecting success info") stats = list(progress_bar.statuses.values()) + if FinalStatus.CANCELLED in stats: + self.ret_code = max(self.ret_code, 130) if FinalStatus.ERROR in stats: self.ret_code = max(self.ret_code, 5) if FinalStatus.UNKNOWN in stats: diff --git a/vmupdate/vmupdate.py b/vmupdate/vmupdate.py index a25d4e8..710b0ab 100644 --- a/vmupdate/vmupdate.py +++ b/vmupdate/vmupdate.py @@ -66,12 +66,18 @@ def main(args=None, app=qubesadmin.Qubes()): # independent qubes first (TemplateVMs, StandaloneVMs) ret_code_independent, templ_statuses = run_update( independent, args, "templates and stanalones") + no_updates = all(stat == FinalStatus.NO_UPDATES for stat in templ_statuses) # then derived qubes (AppVMs...) - ret_code_appvm, _ = run_update(derived, args) + ret_code_appvm, app_statuses = run_update(derived, args) + no_updates = all(stat == FinalStatus.NO_UPDATES for stat in app_statuses + ) and no_updates ret_code_restart = apply_updates_to_appvm(args, independent, templ_statuses) - return max(ret_code_independent, ret_code_appvm, ret_code_restart) + ret_code = max(ret_code_independent, ret_code_appvm, ret_code_restart) + if ret_code == 0 and no_updates: + return 100 + return ret_code def parse_args(args):