File tree Expand file tree Collapse file tree 1 file changed +7
-18
lines changed Expand file tree Collapse file tree 1 file changed +7
-18
lines changed Original file line number Diff line number Diff line change @@ -185,24 +185,13 @@ def read_from_json(self, filename: str) -> None:
185
185
def signable (self ):
186
186
# TODO: probably want to generalise this, a @property.getter in Metadata?
187
187
expires = self .expiration .replace (tzinfo = None ).isoformat ()+ 'Z'
188
- if self .delegations is not None :
189
- return tuf .formats .build_dict_conforming_to_schema (
190
- tuf .formats .TARGETS_SCHEMA ,
191
- version = self .version ,
192
- expires = expires ,
193
- targets = self .targets ,
194
- delegations = self .delegations )
195
- else :
196
- return tuf .formats .build_dict_conforming_to_schema (
197
- tuf .formats .TARGETS_SCHEMA ,
198
- version = self .version ,
199
- expires = expires ,
200
- targets = self .targets )
201
- # TODO: As an alternative to the odd if/else above where we decide whether or
202
- # not to include the delegations argument based on whether or not it is
203
- # None, consider instead adding a check in
204
- # build_dict_conforming_to_schema that skips a keyword if that keyword
205
- # is optional in the schema and the value passed in is set to None....
188
+ return tuf .formats .build_dict_conforming_to_schema (
189
+ tuf .formats .TARGETS_SCHEMA ,
190
+ version = self .version ,
191
+ expires = expires ,
192
+ targets = self .targets ,
193
+ delegations = self .delegations )
194
+
206
195
207
196
# Add or update metadata about the target.
208
197
# TODO: how to handle writing consistent targets?
You can’t perform that action at this time.
0 commit comments