diff options
author | Jenkins <jenkins@review.openstack.org> | 2012-02-10 21:32:14 +0000 |
---|---|---|
committer | Gerrit Code Review <review@openstack.org> | 2012-02-10 21:32:14 +0000 |
commit | 24b7890963b1238a6919f95168890b105c4aa34d (patch) | |
tree | c183de74ef234df218fa1ac559fb9e196cf87e5e /nova/context.py | |
parent | 754320ec661c628d1a7263dc34fd98d6554e652b (diff) | |
parent | 13b82dbbcfe280eda15fd9248a494cb8ce4e5056 (diff) | |
download | nova-24b7890963b1238a6919f95168890b105c4aa34d.tar.gz nova-24b7890963b1238a6919f95168890b105c4aa34d.tar.xz nova-24b7890963b1238a6919f95168890b105c4aa34d.zip |
Merge "Optimizes ec2 keystone usage and handles errors"
Diffstat (limited to 'nova/context.py')
-rw-r--r-- | nova/context.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/nova/context.py b/nova/context.py index d9735e3d2..58deb1318 100644 --- a/nova/context.py +++ b/nova/context.py @@ -20,12 +20,15 @@ """RequestContext: context for requests that persist through all of nova.""" import copy -import uuid from nova import local from nova import utils +def generate_request_id(): + return 'req-' + str(utils.gen_uuid()) + + class RequestContext(object): """Security context and request information. @@ -61,7 +64,7 @@ class RequestContext(object): timestamp = utils.parse_strtime(timestamp) self.timestamp = timestamp if not request_id: - request_id = 'req-' + str(utils.gen_uuid()) + request_id = generate_request_id() self.request_id = request_id self.auth_token = auth_token self.strategy = strategy |