Skip to content

Commit

Permalink
tuf.api: fix loading expiration
Browse files Browse the repository at this point in the history
Signed-off-by: Joshua Lock <jlock@vmware.com>
  • Loading branch information
joshuagl committed Jul 1, 2020
1 parent 2758f48 commit bc1134f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion tuf/api/metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

# 3rd-party.
from dateutil.relativedelta import relativedelta
import iso8601
from securesystemslib.formats import encode_canonical
from securesystemslib.keys import create_signature, verify_signature
from securesystemslib.util import load_json_file
Expand Down Expand Up @@ -51,7 +52,8 @@ def read_from_json(self, filename: str) -> None:
self.signatures = signable['signatures']
self.signed = signable['signed']

self.expiration = datetime.strptime(signed['expiration'], '%b %d %Y %I:%M%p')
# TODO: replace with dateutil.parser.parse?
self.expiration = iso8601.parse_date(self.signed['expires'])
self.version = self.signed['version']

fn, fn_ver = _strip_version_number(filename, True)
Expand Down

0 comments on commit bc1134f

Please sign in to comment.