Repository navigation
Fix prefix file_prefix to support "" value - #1072
Merged
Merged
Conversation
If we run the tuf unit tests with latest, not yet released, securesyslib changes we will see that one unit test is failing because the file_prefix argument should confront the PATH_SCHEMA (which requires a non-empty string) but an empty string value is passed to it. That happens, because in tuf/developer_tool.py create_new_project function the "location_in_repository" arg has a default value of '' and if not changed when creating a new object of type Project on line 650 will cause an exception in the __init__ function because of the file_prefix argument. Signed-off-by: Martin Vrachev <[email protected]>
2 of 3 tasks
joshuagl
approved these changes
Jul 10, 2020
joshuagl
left a comment
Member
There was a problem hiding this comment.
Thanks for the patch Martin!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes issue #: None
Description of the changes being introduced by the pull request:
If we run the tuf unit tests with latest, not yet released,
securesyslib changes we will see that one unit test is failing
because the file_prefix argument should confront the PATH_SCHEMA
(which requires a non-empty string) but an empty string value
is passed to it.
That happens, because in tuf/developer_tool.py create_new_project
function:
https://github.com/theupdateframework/tuf/blob/b309e1befaa1df1df5afd25cd529b5fad3d4b233/tuf/developer_tool.py#L518 the "location_in_repository" arg has a default value of ''
and if not changed when creating a new object of type Project
on line 650:
https://github.com/theupdateframework/tuf/blob/b309e1befaa1df1df5afd25cd529b5fad3d4b233/tuf/developer_tool.py#L650 will cause an exception in the init function
because of the file_prefix argument.
Please verify and check that the pull request fulfills the following
requirements: