summaryrefslogtreecommitdiffstats
path: root/nova
diff options
context:
space:
mode:
authorVishvananda Ishaya <vishvananda@gmail.com>2012-03-15 13:02:07 -0700
committerVishvananda Ishaya <vishvananda@gmail.com>2012-03-15 13:34:19 -0700
commit4012a3f792ca5958616b31f7594f200d18665d71 (patch)
tree444722891796be2626c14e67fe65d119492ab991 /nova
parent97eb92880e0886a3f257f32a88ba9e55b8ec8a90 (diff)
Keep context for logging intact in greenthreads
* fixes bug 942918 Change-Id: Ia0fcf459c53b95a8675472adcfbba08014e34e5b
Diffstat (limited to 'nova')
-rw-r--r--nova/context.py5
-rw-r--r--nova/image/s3.py1
-rw-r--r--nova/rpc/amqp.py2
-rw-r--r--nova/rpc/impl_carrot.py2
4 files changed, 7 insertions, 3 deletions
diff --git a/nova/context.py b/nova/context.py
index c5c3162fb..cab8b2d4b 100644
--- a/nova/context.py
+++ b/nova/context.py
@@ -81,7 +81,10 @@ class RequestContext(object):
self.request_id = request_id
self.auth_token = auth_token
if overwrite or not hasattr(local.store, 'context'):
- local.store.context = self
+ self.update_store()
+
+ def update_store(self):
+ local.store.context = self
def to_dict(self):
return {'user_id': self.user_id,
diff --git a/nova/image/s3.py b/nova/image/s3.py
index 570dfea19..fdf955515 100644
--- a/nova/image/s3.py
+++ b/nova/image/s3.py
@@ -283,6 +283,7 @@ class S3ImageService(object):
def delayed_create():
"""This handles the fetching and decrypting of the part files."""
+ context.update_store()
log_vars = {'image_location': image_location,
'image_path': image_path}
metadata['properties']['image_state'] = 'downloading'
diff --git a/nova/rpc/amqp.py b/nova/rpc/amqp.py
index 367eaf1e8..e620ea36c 100644
--- a/nova/rpc/amqp.py
+++ b/nova/rpc/amqp.py
@@ -244,7 +244,7 @@ class ProxyCallback(object):
"""Thread that magically looks for a method on the proxy
object and calls it.
"""
-
+ ctxt.update_store()
try:
node_func = getattr(self.proxy, str(method))
node_args = dict((str(k), v) for k, v in args.iteritems())
diff --git a/nova/rpc/impl_carrot.py b/nova/rpc/impl_carrot.py
index cc124c25d..22586b1a9 100644
--- a/nova/rpc/impl_carrot.py
+++ b/nova/rpc/impl_carrot.py
@@ -283,7 +283,7 @@ class AdapterConsumer(Consumer):
"""Thread that magically looks for a method on the proxy
object and calls it.
"""
-
+ ctxt.update_store()
node_func = getattr(self.proxy, str(method))
node_args = dict((str(k), v) for k, v in args.iteritems())
# NOTE(vish): magic is fun!