diff options
author | Vishvananda Ishaya <vishvananda@gmail.com> | 2011-06-02 14:23:05 -0700 |
---|---|---|
committer | Vishvananda Ishaya <vishvananda@gmail.com> | 2011-06-02 14:23:05 -0700 |
commit | b2fb1738db489206557abccb631b13991c31fd4e (patch) | |
tree | b18296adbef3f577dcf2b073073196a772ac3787 /nova/api/openstack/auth.py | |
parent | 8b6de21b5ed4248998eef7deb57b1bc4f3863276 (diff) | |
download | nova-b2fb1738db489206557abccb631b13991c31fd4e.tar.gz nova-b2fb1738db489206557abccb631b13991c31fd4e.tar.xz nova-b2fb1738db489206557abccb631b13991c31fd4e.zip |
make all uses of utcnow use our testable utils.utcnow
Diffstat (limited to 'nova/api/openstack/auth.py')
-rw-r--r-- | nova/api/openstack/auth.py | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/nova/api/openstack/auth.py b/nova/api/openstack/auth.py index 6c6ee22a2..b49bf449b 100644 --- a/nova/api/openstack/auth.py +++ b/nova/api/openstack/auth.py @@ -13,9 +13,8 @@ # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations -# under the License.import datetime +# under the License. -import datetime import hashlib import time @@ -127,7 +126,7 @@ class AuthMiddleware(wsgi.Middleware): except exception.NotFound: return None if token: - delta = datetime.datetime.utcnow() - token['created_at'] + delta = utils.utcnow() - token['created_at'] if delta.days >= 2: self.db.auth_token_destroy(ctxt, token['token_hash']) else: |