Skip to content

Commit 5ea1f63

Browse files
committed
Remove custom parameter from add_target_to_bin()
We intend to deprecate the custom parameter of add_target() in favour of using the fileinfo parameter with the custom value populated, therefore it does not make sense to _add_ the custom parameter to add_target_to_bin() Signed-off-by: Joshua Lock <[email protected]>
1 parent f362544 commit 5ea1f63

File tree

1 file changed

+2
-10
lines changed

1 file changed

+2
-10
lines changed

tuf/repository_tool.py

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2556,8 +2556,7 @@ def delegate_hashed_bins(self, list_of_targets, keys_of_hashed_bins,
25562556

25572557

25582558

2559-
def add_target_to_bin(self, target_filepath, number_of_bins, custom=None,
2560-
fileinfo=None):
2559+
def add_target_to_bin(self, target_filepath, number_of_bins, fileinfo=None):
25612560
"""
25622561
<Purpose>
25632562
Add the fileinfo of 'target_filepath' to the expected hashed bin, if the
@@ -2578,9 +2577,6 @@ def add_target_to_bin(self, target_filepath, number_of_bins, custom=None,
25782577
The number of delegated roles, or hashed bins, in use by the repository.
25792578
Note: 'number_of_bins' must be a power of 2.
25802579
2581-
custom:
2582-
An optional object providing additional information about the file.
2583-
25842580
fileinfo:
25852581
An optional fileinfo object, conforming to tuf.formats.FILEINFO_SCHEMA,
25862582
providing full information about the file.
@@ -2589,9 +2585,6 @@ def add_target_to_bin(self, target_filepath, number_of_bins, custom=None,
25892585
securesystemslib.exceptions.FormatError, if 'target_filepath' is
25902586
improperly formatted.
25912587
2592-
securesystemslib.exceptions.Error, if both 'custom' and 'fileinfo' are
2593-
passed.
2594-
25952588
securesystemslib.exceptions.Error, if 'target_filepath' cannot be added to
25962589
a hashed bin (e.g., an invalid target filepath, or the expected hashed
25972590
bin does not exist.)
@@ -2621,8 +2614,7 @@ def add_target_to_bin(self, target_filepath, number_of_bins, custom=None,
26212614
raise securesystemslib.exceptions.Error(self.rolename + ' does not have'
26222615
' a delegated role ' + bin_name)
26232616

2624-
self._delegated_roles[bin_name].add_target(target_filepath, custom,
2625-
fileinfo)
2617+
self._delegated_roles[bin_name].add_target(target_filepath, fileinfo)
26262618

26272619

26282620

0 commit comments

Comments
 (0)