mirror of
https://github.com/theupdateframework/python-tuf
synced 2026-05-24 10:08:28 +00:00
Stop using formats.py in metadata.py
Currently we have one use of tuf/formats.py in tuf/api/metadata.py. If we do the conversion of the expires string in metadata.py, we can keep the two implementations separate. Signed-off-by: Velichka Atanasova <avelichka@vmware.com>
This commit is contained in:
parent
0b54cafa94
commit
4e8a0fe140
1 changed files with 2 additions and 2 deletions
|
|
@ -25,7 +25,7 @@
|
|||
from securesystemslib.storage import FilesystemBackend, StorageBackendInterface
|
||||
from securesystemslib.util import persist_temp_file
|
||||
|
||||
from tuf import exceptions, formats
|
||||
from tuf import exceptions
|
||||
from tuf.api.serialization import (
|
||||
MetadataDeserializer,
|
||||
MetadataSerializer,
|
||||
|
|
@ -384,7 +384,7 @@ def _common_fields_from_dict(
|
|||
# Convert 'expires' TUF metadata string to a datetime object, which is
|
||||
# what the constructor expects and what we store. The inverse operation
|
||||
# is implemented in '_common_fields_to_dict'.
|
||||
expires = formats.expiry_string_to_datetime(expires_str)
|
||||
expires = datetime.strptime(expires_str, "%Y-%m-%dT%H:%M:%SZ")
|
||||
return version, spec_version, expires
|
||||
|
||||
def _common_fields_to_dict(self) -> Dict[str, Any]:
|
||||
|
|
|
|||
Loading…
Reference in a new issue