Skip to content

Commit 4e8a0fe

Browse files
committed
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>
1 parent 0b54caf commit 4e8a0fe

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

tuf/api/metadata.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
from securesystemslib.storage import FilesystemBackend, StorageBackendInterface
2626
from securesystemslib.util import persist_temp_file
2727

28-
from tuf import exceptions, formats
28+
from tuf import exceptions
2929
from tuf.api.serialization import (
3030
MetadataDeserializer,
3131
MetadataSerializer,
@@ -384,7 +384,7 @@ def _common_fields_from_dict(
384384
# Convert 'expires' TUF metadata string to a datetime object, which is
385385
# what the constructor expects and what we store. The inverse operation
386386
# is implemented in '_common_fields_to_dict'.
387-
expires = formats.expiry_string_to_datetime(expires_str)
387+
expires = datetime.strptime(expires_str, "%Y-%m-%dT%H:%M:%SZ")
388388
return version, spec_version, expires
389389

390390
def _common_fields_to_dict(self) -> Dict[str, Any]:

0 commit comments

Comments
 (0)