Remove use of positional decorator

The positional decorator results in poorly maintainable code in
a misguided effort to emulate python3's key-word-arg only notation
and functionality. This patch removes oslo.context dependance
on the positional decorator.

Change-Id: I9b83917fedd00a8d4fdf904208a17ebdc5cda59a
This commit is contained in:
Morgan Fainberg 2017-08-07 13:19:16 -07:00
parent 3d96a20f2c
commit a144ebd6c3
3 changed files with 0 additions and 10 deletions

View File

@ -33,7 +33,6 @@ import uuid
import warnings
import debtcollector
from positional import positional
_request_store = threading.local()
@ -179,7 +178,6 @@ class RequestContext(object):
user_idt_format = u'{user} {tenant} {domain} {user_domain} {p_domain}'
@positional(enforcement=positional.WARN)
def __init__(self,
auth_token=None,
user=None,

View File

@ -562,13 +562,6 @@ class ContextTest(test_base.BaseTestCase):
'service_roles': service_roles},
ctx.to_policy_values())
def test_positional_args(self):
context.RequestContext('abc', 'def')
self.assertEqual(1, len(self.warnings.log))
self.assertIn('__init__ takes at most 1 positional',
str(self.warnings.log[0].message))
def test_policy_deprecations(self):
user = uuid.uuid4().hex
user_domain = uuid.uuid4().hex

View File

@ -5,4 +5,3 @@
pbr!=2.1.0,>=2.0.0 # Apache-2.0
debtcollector>=1.2.0 # Apache-2.0
positional>=1.1.1 # Apache-2.0