Skip to content

check if absolute path when add target into repo #878

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion tuf/scripts/repo.py
Original file line number Diff line number Diff line change
Expand Up @@ -701,7 +701,10 @@ def add_target_to_repo(parsed_arguments, target_path, repo_targets_path,

if not os.path.exists(target_path):
logger.debug(repr(target_path) + ' does not exist. Skipping.')


elif os.path.isabs(target_path):
logger.warn('omit this file:' + target_path + ', the target '
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

logger.warn is deprecated, use logger.warning instead (see linter message)

'file should be in ' + parsed_arguments.path)
else:
securesystemslib.util.ensure_parent_dir(
os.path.join(repo_targets_path, target_path))
Expand Down