Skip to content

Commit ad4e671

Browse files
author
Jussi Kukkonen
committed
New updater: Update comments
Mostly remove comments that provide little value after all the changes. Also remove a unused variable from a test. Signed-off-by: Jussi Kukkonen <jkukkonen@vmware.com>
1 parent 2bbf5bc commit ad4e671

2 files changed

Lines changed: 1 addition & 16 deletions

File tree

tests/test_updater_rework.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,6 @@ def setUp(self):
7979
# We are inheriting from custom class.
8080
unittest_toolbox.Modified_TestCase.setUp(self)
8181

82-
self.repository_name = 'test_repository1'
83-
8482
# Copy the original repository files provided in the test folder so that
8583
# any modifications made to repository files are restricted to the copies.
8684
# The 'repository_data' directory is expected to exist in 'tuf.tests/'.
@@ -130,7 +128,7 @@ def tearDown(self):
130128
self.server_process_handler.flush_log()
131129

132130
def test_refresh(self):
133-
131+
# All metadata is in local directory already
134132
self.repository_updater.refresh()
135133

136134
# Get targetinfo for 'file1.txt' listed in targets

tuf/client_rework/updater_rework.py

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -333,14 +333,6 @@ def _preorder_depth_first_walk(self, target_filepath) -> Dict:
333333
visited_role_names = set()
334334
number_of_delegations = MAX_DELEGATIONS
335335

336-
# Ensure the client has the most up-to-date version of 'targets.json'.
337-
# Raise 'exceptions.NoWorkingMirrorError' if the changed metadata
338-
# cannot be successfully downloaded and
339-
# 'exceptions.RepositoryError' if the referenced metadata is
340-
# missing. Target methods such as this one are called after the
341-
# top-level metadata have been refreshed (i.e., updater.refresh()).
342-
# self._update_metadata_if_changed('targets')
343-
344336
# Preorder depth-first traversal of the graph of target delegations.
345337
while (
346338
target is None and number_of_delegations > 0 and len(role_names) > 0
@@ -357,11 +349,6 @@ def _preorder_depth_first_walk(self, target_filepath) -> Dict:
357349

358350
# The metadata for 'role_name' must be downloaded/updated before
359351
# its targets, delegations, and child roles can be inspected.
360-
# _refresh_targets_metadata() does not refresh 'targets.json', it
361-
# expects _update_metadata_if_changed() to have already refreshed
362-
# it, which this function has checked above.
363-
# self._refresh_targets_metadata(role_name,
364-
# refresh_all_delegated_roles=False)
365352

366353
role_metadata = self._bundle[role_name].signed
367354
target = role_metadata.targets.get(target_filepath)

0 commit comments

Comments
 (0)