Skip to content

Commit

Permalink
Change JSON key "last_updated" in sdw-update-flag to "last_status_u…
Browse files Browse the repository at this point in the history
…pdate"

The use of `last_updated` here is ambiguous with with the usage in the
separate file `sdw-last-udpated`, which contains the time of the
last successful update of the SecureDrop Workstation.

The `last_updated` key in `sdw-last-updated` contains the timestamp of
the last time the status itself was written to disk, regardless of
success or failure.
  • Loading branch information
eloquence committed Jan 28, 2020
1 parent 87b2c61 commit e222458
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions launcher/sdw_updater_gui/Updater.py
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ def _write_updates_status_flag_to_disk(status):
current_date = str(datetime.now().strftime(DATE_FORMAT))

with open(flag_file_path_dom0, "w") as f:
flag_contents = {"last_updated": current_date, "status": status.value}
flag_contents = {"last_status_update": current_date, "status": status.value}
json.dump(flag_contents, f)
except Exception as e:
sdlog.error("Error writing update status flag to dom0")
Expand All @@ -303,7 +303,7 @@ def last_required_reboot_performed():
return True

if int(flag_contents["status"]) == int(UpdateStatus.REBOOT_REQUIRED.value):
reboot_time = datetime.strptime(flag_contents["last_updated"], DATE_FORMAT)
reboot_time = datetime.strptime(flag_contents["last_status_update"], DATE_FORMAT)
boot_time = datetime.now() - _get_uptime()

# The session was started *before* the reboot was requested by
Expand Down

0 comments on commit e222458

Please sign in to comment.