From 4f8dd44b1eb50d5902bf0def32f9ec5317e6c100 Mon Sep 17 00:00:00 2001 From: Ronald Bradford Date: Wed, 6 Apr 2016 12:57:30 -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__. requirements.txt updated to match global requirements. There is no Proposal Bot request for this. Change-Id: I1e00d8b2cf48403a7e2e4387431a835ecc69d86a --- cloudkitty/common/context.py | 9 ++------- requirements.txt | 2 +- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/cloudkitty/common/context.py b/cloudkitty/common/context.py index a3bf4aaa..8999ac1f 100644 --- a/cloudkitty/common/context.py +++ b/cloudkitty/common/context.py @@ -37,13 +37,8 @@ class RequestContext(context.RequestContext): show_deleted=show_deleted, request_id=request_id, resource_uuid=resource_uuid, - overwrite=overwrite) - self.roles = roles or [] - - def to_dict(self): - d = super(RequestContext, self).to_dict() - d['roles'] = self.roles - return d + overwrite=overwrite, + roles=roles) @classmethod def from_dict(cls, values): diff --git a/requirements.txt b/requirements.txt index f43ffcdf..cfb2ce62 100644 --- a/requirements.txt +++ b/requirements.txt @@ -13,7 +13,7 @@ PasteDeploy>=1.5.0 # MIT pecan>=1.0.0 # BSD WSME>=0.8 # MIT oslo.config>=3.7.0 # Apache-2.0 -oslo.context>=0.2.0 # Apache-2.0 +oslo.context>=2.2.0 # Apache-2.0 oslo.concurrency>=3.5.0 # Apache-2.0 oslo.db>=4.1.0 # Apache-2.0 oslo.i18n>=2.1.0 # Apache-2.0