From c3af66848060109fbaac0cd2394b79a28d5d686a Mon Sep 17 00:00:00 2001 From: Ronald Bradford Date: Wed, 6 Apr 2016 13:09:26 -0400 Subject: [PATCH] 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 --- zaqar/context.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/zaqar/context.py b/zaqar/context.py index 7d3f400e9..339b091ef 100644 --- a/zaqar/context.py +++ b/zaqar/context.py @@ -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