From b0b3a3db00347b82d6e14c174874b71cf3a06bf8 Mon Sep 17 00:00:00 2001 From: Yang Hongyang Date: Thu, 25 Feb 2016 19:56:43 +0800 Subject: [PATCH] Init oslo_context before magnum context init Roles is added as a member of oslo.context since oslo 2.2.0 https://review.openstack.org/#/c/271928/ This causes magnum gate fail because roles is overwrited by oslo_context. Let's init oslo_context first and then make our local changes. Change-Id: Iac8c568bd49fbc66d2d65c9b6083bc9895a8069c Closes-Bug: #1549694 --- magnum/common/context.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/magnum/common/context.py b/magnum/common/context.py index fca441caad..9e8ebf8300 100644 --- a/magnum/common/context.py +++ b/magnum/common/context.py @@ -29,6 +29,14 @@ class RequestContext(context.RequestContext): :param domain_name: The name of the domain. """ + super(RequestContext, self).__init__(auth_token=auth_token, + user=user_name, + tenant=project_name, + is_admin=is_admin, + read_only=read_only, + show_deleted=show_deleted, + request_id=request_id) + self.user_name = user_name self.user_id = user_id self.project_name = project_name @@ -41,14 +49,6 @@ class RequestContext(context.RequestContext): self.trust_id = trust_id self.all_tenants = all_tenants - super(RequestContext, self).__init__(auth_token=auth_token, - user=user_name, - tenant=project_name, - is_admin=is_admin, - read_only=read_only, - show_deleted=show_deleted, - request_id=request_id) - def to_dict(self): value = super(RequestContext, self).to_dict() value.update({'auth_token': self.auth_token,