From e650670f77414447908eedfc11e40e6746c42460 Mon Sep 17 00:00:00 2001 From: Martin Vrachev Date: Tue, 7 Jul 2020 16:24:14 +0300 Subject: [PATCH] Fix prefix file_prefix to support "" value 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 --- tuf/developer_tool.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tuf/developer_tool.py b/tuf/developer_tool.py index 685e754a42..0db06fe847 100755 --- a/tuf/developer_tool.py +++ b/tuf/developer_tool.py @@ -190,7 +190,7 @@ def __init__(self, project_name, metadata_directory, targets_directory, securesystemslib.formats.NAME_SCHEMA.check_match(project_name) securesystemslib.formats.PATH_SCHEMA.check_match(metadata_directory) securesystemslib.formats.PATH_SCHEMA.check_match(targets_directory) - securesystemslib.formats.PATH_SCHEMA.check_match(file_prefix) + securesystemslib.formats.ANY_STRING_SCHEMA.check_match(file_prefix) securesystemslib.formats.NAME_SCHEMA.check_match(repository_name) self.metadata_directory = metadata_directory