Permalink
Browse files

Use uctnow instead of now for credential expiry

The timestamps for expiration time look like this:

  "Expiration" : "2012-09-18T21:21:58Z"

So we should be using utcnow() when checking for credential
expiry.
  • Loading branch information...
1 parent dbaf091 commit 69b6e4a79eae65cc8d8a4486672a2b4187d4a652 @jamesls jamesls committed Sep 18, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 boto/provider.py
View
@@ -217,7 +217,7 @@ def _credentials_need_refresh(self):
else:
# The credentials should be refreshed if they're going to expire
# in less than 5 minutes.
- delta = self._credential_expiry_time - datetime.now()
+ delta = self._credential_expiry_time - datetime.utcnow()
# python2.6 does not have timedelta.total_seconds() so we have
# to calculate this ourselves. This is straight from the
# datetime docs.

0 comments on commit 69b6e4a

Please sign in to comment.