Define context.roles with base class

In f383bd2973c58c5272504603e4f9dddd55c5bb68, oslo.context (2.2.0)
added roles support in the context itself. This passes roles to
super()__init__.

Change-Id: I0535728846006c0ad26c75a8fe36071e96e96f71
This commit is contained in:
Ronald Bradford 2016-04-06 13:09:26 -04:00 committed by wangxiyuan
parent e007e474e6
commit c3af668480

View File

@ -36,10 +36,10 @@ class RequestContext(context.RequestContext):
is_admin=is_admin,
read_only=read_only,
show_deleted=False,
request_id=request_id)
request_id=request_id,
roles=roles)
self.project_id = project_id
self.client_id = client_id
self.roles = roles
if overwrite or not hasattr(context._request_store, 'context'):
self.update_store()
@ -50,8 +50,6 @@ class RequestContext(context.RequestContext):
ctx = super(RequestContext, self).to_dict()
ctx.update({
'project_id': self.project_id,
'client_id': self.client_id,
'tenant': self.tenant,
'roles': self.roles
'client_id': self.client_id
})
return ctx