mirror of
https://github.com/theupdateframework/python-tuf
synced 2026-05-24 10:08:28 +00:00
Correctly delegate paths via add_paths() in repository_tool.py
Signed-off-by: Vladimir Diaz <vladimir.v.diaz@gmail.com>
This commit is contained in:
parent
6edad831c5
commit
b3cc7dfeb6
1 changed files with 6 additions and 0 deletions
|
|
@ -1814,6 +1814,10 @@ def add_paths(self, paths, child_rolename):
|
|||
securesystemslib.formats.PATHS_SCHEMA.check_match(paths)
|
||||
tuf.formats.ROLENAME_SCHEMA.check_match(child_rolename)
|
||||
|
||||
# A list of relative and verified paths or glob patterns to be added to the
|
||||
# child role's entry in the parent's delegations field.
|
||||
relative_paths = []
|
||||
|
||||
# Ensure that 'child_rolename' exists, otherwise it will not have an entry
|
||||
# in the parent role's delegations field.
|
||||
if not tuf.roledb.role_exists(child_rolename, self._repository_name):
|
||||
|
|
@ -1831,6 +1835,8 @@ def add_paths(self, paths, child_rolename):
|
|||
' repository\'s targets'
|
||||
' directory: ' + repr(self._targets_directory))
|
||||
|
||||
relative_paths.append(path)
|
||||
|
||||
# Get the current role's roleinfo, so that its delegations field can be
|
||||
# updated.
|
||||
roleinfo = tuf.roledb.get_roleinfo(self._rolename, self._repository_name)
|
||||
|
|
|
|||
Loading…
Reference in a new issue