diff --git a/nova/context.py b/nova/context.py index c5c3162fb400..cab8b2d4b21c 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 570dfea19cd6..fdf955515524 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 367eaf1e8840..e620ea36c641 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 cc124c25d146..22586b1a9a2e 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!