Skip to content

Commit

Permalink
Merge pull request #436 from freedomofpress/435-reboot-no-updates
Browse files Browse the repository at this point in the history
Show reboot when no updates are required (and user did not reboot)
  • Loading branch information
kushaldas authored Feb 4, 2020
2 parents 6640271 + 57836ab commit 05ddb1f
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions launcher/sdw_updater_gui/UpdaterApp.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,30 @@ def update_status(self, result):
self.proposedActionDescription.setText(
strings.description_status_up_to_date
)
elif result["recommended_action"] == UpdateStatus.REBOOT_REQUIRED:
logger.info("Reboot will be required")
# We also have further updates to do, let's apply updates and reboot
# once those are done
if len(self.get_vms_that_need_upgrades(result)) > 0:
logger.info("Reboot will be after applying upgrades")
self.vms_to_update = self.get_vms_that_need_upgrades(result)
self.applyUpdatesButton.setEnabled(True)
self.applyUpdatesButton.show()
self.cancelButton.setEnabled(True)
self.cancelButton.show()
self.proposedActionDescription.setText(
strings.description_status_updates_available
)
# No updates required, show reboot button.
else:
logger.info("Reboot required")
self.rebootButton.setEnabled(True)
self.rebootButton.show()
self.cancelButton.setEnabled(True)
self.cancelButton.show()
self.proposedActionDescription.setText(
strings.description_status_reboot_required
)
else:
logger.error("Error checking for updates")
logger.error(str(result))
Expand Down

0 comments on commit 05ddb1f

Please sign in to comment.