mirror of
https://github.com/theupdateframework/python-tuf
synced 2026-05-24 10:08:28 +00:00
Fix replacing targets in add_targets()
Match the pattern in add_target() where if the filepath already exists in roleinfo['paths'] it is updated to replace the existing entry with the new fileinfo. Signed-off-by: Joshua Lock <jlock@vmware.com>
This commit is contained in:
parent
095fd40dcb
commit
468a380ea4
1 changed files with 1 additions and 1 deletions
|
|
@ -2027,10 +2027,10 @@ def add_targets(self, list_of_targets):
|
|||
for relative_target in relative_list_of_targets:
|
||||
if relative_target not in roleinfo['paths']:
|
||||
logger.debug('Adding new target: ' + repr(relative_target))
|
||||
roleinfo['paths'].update({relative_target: {}})
|
||||
|
||||
else:
|
||||
logger.debug('Replacing target: ' + repr(relative_target))
|
||||
roleinfo['paths'].update({relative_target: {}})
|
||||
|
||||
tuf.roledb.update_roleinfo(self.rolename, roleinfo,
|
||||
repository_name=self._repository_name)
|
||||
|
|
|
|||
Loading…
Reference in a new issue