From c6ad8e37ec6d8c17dd7ff4cc106430c2c73008a7 Mon Sep 17 00:00:00 2001 From: Lukas Puehringer Date: Fri, 4 Oct 2019 17:33:12 +0200 Subject: [PATCH] Remove duplicate role-related schemas - remove duplicate ROLENAME_SCHEMA and ROLEDICT_SCHEMA - remove outdated and duplicate ROLE_SCHEMA Note that this is a quick fix that may be overridden with refactoring work in #660/#846. Signed-off-by: Lukas Puehringer --- tuf/formats.py | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/tuf/formats.py b/tuf/formats.py index b3e711985d..d666008578 100755 --- a/tuf/formats.py +++ b/tuf/formats.py @@ -163,9 +163,6 @@ # A value that is either True or False, on or off, etc. BOOLEAN_SCHEMA = SCHEMA.Boolean() -# A string representing a role's name. -ROLENAME_SCHEMA = SCHEMA.AnyString() - # A hexadecimal value in '23432df87ab..' format. HASH_SCHEMA = SCHEMA.RegularExpression(r'[a-fA-F0-9]+') @@ -216,23 +213,6 @@ unknown_sigs = KEYIDS_SCHEMA, untrusted_sigs = KEYIDS_SCHEMA) -# Role object in {'keyids': [keydids..], 'name': 'ABC', 'threshold': 1, -# 'paths':[filepaths..]} format. -ROLE_SCHEMA = SCHEMA.Object( - object_name = 'ROLE_SCHEMA', - name = SCHEMA.Optional(ROLENAME_SCHEMA), - keyids = KEYIDS_SCHEMA, - threshold = THRESHOLD_SCHEMA, - backtrack = SCHEMA.Optional(BOOLEAN_SCHEMA), - paths = SCHEMA.Optional(RELPATHS_SCHEMA), - path_hash_prefixes = SCHEMA.Optional(PATH_HASH_PREFIXES_SCHEMA)) - -# A dict of roles where the dict keys are role names and the dict values holding -# the role data/information. -ROLEDICT_SCHEMA = SCHEMA.DictOf( - key_schema = ROLENAME_SCHEMA, - value_schema = ROLE_SCHEMA) - # An integer representing length. Must be 0, or greater. LENGTH_SCHEMA = SCHEMA.Integer(lo=0)