diff --git a/tuf/repository_tool.py b/tuf/repository_tool.py index b60f7db2..04fa0401 100755 --- a/tuf/repository_tool.py +++ b/tuf/repository_tool.py @@ -1141,6 +1141,10 @@ def expiration(self, datetime_object): message = repr(datetime_object) + ' is not a datetime.datetime() object.' raise tuf.FormatError(message) + # truncate the microseconds value to produce a correct schema string + # of the form yyyy-mm-ddThh:mm:ssZ + datetime_object = datetime_object.replace(microsecond = 0) + # Ensure the expiration has not already passed. current_datetime_object = \ tuf.formats.unix_timestamp_to_datetime(int(time.time()))