theupdateframework/tuf — pull request #213 by SantiagoTorres (2014-05-02 23:30:58+00:00)
Title: Fixes wrong schema when adding an expiration that contains microseconds

In the case we want a different expiration date on any role, we are
adviced to do this:

repo.role.expiration = datetime.datetime(some value).

In the case we want to use a date somewhere in the future, a normal
approach would be to use time deltas:

repo.role.expiration = datetime.today() + timedelta(weeks=x)

If we use this method we won't be able to set the value since we are
most probably producing a datetime object that contains *microseconds*.
According to the python specification, the timestamp produced will
contain the microseconds value unless it is 0.

The simple fix for this issue is to force the microseconds value to be 0
before working with the datetime object.