diff options
author | Eric Day <eday@oddments.org> | 2010-10-21 11:49:51 -0700 |
---|---|---|
committer | Eric Day <eday@oddments.org> | 2010-10-21 11:49:51 -0700 |
commit | e012a2b73725bded6d4ac39747d57affda545770 (patch) | |
tree | 3c675423e1d7f5b187b70723bf0d02b3f1e5d1b5 /nova/context.py | |
parent | 3e3407f2e4f44e7f717bba94219bb0023695fc4d (diff) | |
download | nova-e012a2b73725bded6d4ac39747d57affda545770.tar.gz nova-e012a2b73725bded6d4ac39747d57affda545770.tar.xz nova-e012a2b73725bded6d4ac39747d57affda545770.zip |
PEP8 and pylint cleanup. There should be no functional changes here, just style changes to get violations down.
Diffstat (limited to 'nova/context.py')
-rw-r--r-- | nova/context.py | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/nova/context.py b/nova/context.py index f5d3fed08..f2669c9f1 100644 --- a/nova/context.py +++ b/nova/context.py @@ -26,7 +26,9 @@ import random from nova import exception 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'): @@ -56,10 +58,8 @@ class RequestContext(object): timestamp = utils.parse_isotime(timestamp) self.timestamp = timestamp if not request_id: - request_id = ''.join( - [random.choice('ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890-') - for x in xrange(20)] - ) + chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890-' + request_id = ''.join([random.choice(chars) for x in xrange(20)]) self.request_id = request_id @property @@ -81,7 +81,8 @@ class RequestContext(object): from nova.auth import manager if not self._project: try: - self._project = manager.AuthManager().get_project(self.project_id) + auth_manager = manager.AuthManager() + self._project = auth_manager.get_project(self.project_id) except exception.NotFound: pass return self._project |