heat.filter_factory = heat.api.middleware.cache_manage:CacheManageFilter
[filter:context]
-paste.filter_factory = heat.common.wsgi:filter_factory
-heat.filter_factory = heat.common.context:ContextMiddleware
+paste.filter_factory = heat.common.context:ContextMiddleware_filter_factory
[filter:ec2authtoken]
paste.filter_factory = heat.common.wsgi:filter_factory
heat.app_factory = heat.metadata.api.v1:API
[filter:context]
-paste.filter_factory = heat.common.wsgi:filter_factory
-heat.filter_factory = heat.common.context:ContextMiddleware
+paste.filter_factory = heat.common.context:ContextMiddleware_filter_factory
]
def __init__(self, app, conf, **local_conf):
- self.conf = conf
- self.conf.register_opts(self.opts)
+ cfg.CONF.register_opts(self.opts)
# Determine the context class to use
self.ctxcls = RequestContext
"""
Create a context with the given arguments.
"""
- kwargs.setdefault('owner_is_tenant', self.conf.owner_is_tenant)
+ kwargs.setdefault('owner_is_tenant', cfg.CONF.owner_is_tenant)
return self.ctxcls(*args, **kwargs)
service_password=service_password,
auth_url=auth_url, roles=roles,
is_admin=True)
+
+
+def ContextMiddleware_filter_factory(global_conf, **local_conf):
+ """
+ Factory method for paste.deploy
+ """
+ conf = global_conf.copy()
+ conf.update(local_conf)
+
+ def filter(app):
+ return ContextMiddleware(app, conf)
+
+ return filter