summaryrefslogtreecommitdiffstats
path: root/nova/context.py
diff options
context:
space:
mode:
authortermie <github@anarkystic.com>2011-01-30 15:55:48 -0800
committertermie <github@anarkystic.com>2011-01-30 15:55:48 -0800
commitf76a0a9d4d8aa3d8cc2669da1a8eea7d610a8616 (patch)
treee8aa36a06899a8e7a0c55326b8b4b6d0af6421e5 /nova/context.py
parent396b02f876030f1f54b7af32cf94fccbbe1fe46b (diff)
downloadnova-f76a0a9d4d8aa3d8cc2669da1a8eea7d610a8616.tar.gz
nova-f76a0a9d4d8aa3d8cc2669da1a8eea7d610a8616.tar.xz
nova-f76a0a9d4d8aa3d8cc2669da1a8eea7d610a8616.zip
trivial cleanup for context.py
Diffstat (limited to 'nova/context.py')
-rw-r--r--nova/context.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/nova/context.py b/nova/context.py
index f2669c9f1..76e46703a 100644
--- a/nova/context.py
+++ b/nova/context.py
@@ -28,7 +28,6 @@ from nova import utils
class RequestContext(object):
-
def __init__(self, user, project, is_admin=None, read_deleted=False,
remote_address=None, timestamp=None, request_id=None):
if hasattr(user, 'id'):
@@ -53,7 +52,7 @@ class RequestContext(object):
self.read_deleted = read_deleted
self.remote_address = remote_address
if not timestamp:
- timestamp = datetime.datetime.utcnow()
+ timestampe = utils.utcnow()
if isinstance(timestamp, str) or isinstance(timestamp, unicode):
timestamp = utils.parse_isotime(timestamp)
self.timestamp = timestamp
@@ -101,7 +100,7 @@ class RequestContext(object):
return cls(**values)
def elevated(self, read_deleted=False):
- """Return a version of this context with admin flag set"""
+ """Return a version of this context with admin flag set."""
return RequestContext(self.user_id,
self.project_id,
True,