Skip to content
This repository was archived by the owner on Mar 29, 2022. It is now read-only.

Commit cc39767

Browse files
committed
PR revision: retrieve timeserver key metadata correctly
The mechanism for retrieving metadata from the TAP4-conforming multi-repository-updater is the Updater.get_metadata() call. Note that until the test metadata includes timeserver keys, the tests will still fail. Signed-off-by: Sebastien Awwad <sebastien.awwad@gmail.com>
1 parent b9a8ae2 commit cc39767

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

uptane/clients/primary.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -358,8 +358,8 @@ def refresh_toplevel_metadata_from_repositories(self):
358358

359359

360360
# Make note of the currently-trusted Timeserver key.
361-
current_trusted_timeserver_key = \
362-
self.updater.metadata['current']['root']['roles']['timeserver']
361+
current_trusted_timeserver_key = self.updater.get_metadata(
362+
self.director_repo_name, 'current')['root']['roles']['timeserver']
363363

364364
try:
365365
self.updater.refresh()
@@ -379,8 +379,8 @@ def refresh_toplevel_metadata_from_repositories(self):
379379
self.updater.refresh()
380380

381381
else:
382-
new_trusted_timeserver_key = \
383-
self.updater.metadata['current']['root']['roles']['timeserver']
382+
new_trusted_timeserver_key = self.updater.get_metadata(
383+
self.director_repo_name, 'current')['root']['roles']['timeserver']
384384

385385
if current_trusted_timeserver_key != new_trusted_timeserver_key:
386386
self.reset_clock()

0 commit comments

Comments
 (0)