From eecaf4d2f3c62b308697f6865a5e120d0409870b Mon Sep 17 00:00:00 2001 From: Michael Basnight Date: Tue, 5 Mar 2013 10:08:57 -0600 Subject: [PATCH] Store the context in the local.store. fixes bug 1147173 Change-Id: Ida78074a8003cf2411122352387f4e593cbf84c5 --- reddwarf/common/context.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/reddwarf/common/context.py b/reddwarf/common/context.py index 82f2d3a8a8..07be845ac2 100644 --- a/reddwarf/common/context.py +++ b/reddwarf/common/context.py @@ -23,6 +23,7 @@ context or provide additional information in their specific WSGI pipeline. """ from reddwarf.openstack.common import context +from reddwarf.openstack.common import local from reddwarf.common import utils @@ -42,6 +43,9 @@ class ReddwarfContext(context.RequestContext): del kwargs['marker'] super(ReddwarfContext, self).__init__(**kwargs) + if not hasattr(local.store, 'context'): + self.update_store() + def to_dict(self): parent_dict = super(ReddwarfContext, self).to_dict() parent_dict.update({'limit': self.limit, @@ -49,6 +53,9 @@ class ReddwarfContext(context.RequestContext): }) return parent_dict + def update_store(self): + local.store.context = self + @classmethod def from_dict(cls, values): return cls(**values)