Removed a pile of debtcollector removals from neutron.context
The next dev cycle is up, so let's get rid of that old stuff. Related-Bug: #1449462 Related-Bug: #1446021 Change-Id: I0561a6c4ea420ba06029a88db442bf7165f755df
This commit is contained in:
parent
75ec30f650
commit
0396b3de79
@ -18,7 +18,6 @@
|
||||
import copy
|
||||
import datetime
|
||||
|
||||
from debtcollector import removals
|
||||
from oslo_context import context as oslo_context
|
||||
from oslo_log import log as logging
|
||||
|
||||
@ -36,7 +35,6 @@ class ContextBase(oslo_context.RequestContext):
|
||||
|
||||
"""
|
||||
|
||||
@removals.removed_kwarg('read_deleted')
|
||||
def __init__(self, user_id, tenant_id, is_admin=None, roles=None,
|
||||
timestamp=None, request_id=None, tenant_name=None,
|
||||
user_name=None, overwrite=True, auth_token=None,
|
||||
@ -105,8 +103,7 @@ class ContextBase(oslo_context.RequestContext):
|
||||
def from_dict(cls, values):
|
||||
return cls(**values)
|
||||
|
||||
@removals.removed_kwarg('read_deleted')
|
||||
def elevated(self, read_deleted=None):
|
||||
def elevated(self):
|
||||
"""Return a version of this context with admin flag set."""
|
||||
context = copy.copy(self)
|
||||
context.is_admin = True
|
||||
@ -129,17 +126,14 @@ class Context(ContextBase):
|
||||
return self._session
|
||||
|
||||
|
||||
@removals.removed_kwarg('read_deleted')
|
||||
@removals.removed_kwarg('load_admin_roles')
|
||||
def get_admin_context(read_deleted="no", load_admin_roles=True):
|
||||
def get_admin_context():
|
||||
return Context(user_id=None,
|
||||
tenant_id=None,
|
||||
is_admin=True,
|
||||
overwrite=False)
|
||||
|
||||
|
||||
@removals.removed_kwarg('read_deleted')
|
||||
def get_admin_context_without_session(read_deleted="no"):
|
||||
def get_admin_context_without_session():
|
||||
return ContextBase(user_id=None,
|
||||
tenant_id=None,
|
||||
is_admin=True)
|
||||
|
@ -303,8 +303,7 @@ class TestQuotaDbApiAdminContext(TestQuotaDbApi):
|
||||
def _set_context(self):
|
||||
self.tenant_id = 'Higuain'
|
||||
self.context = context.Context('Gonzalo', self.tenant_id,
|
||||
is_admin=True, is_advsvc=True,
|
||||
load_admin_roles=False)
|
||||
is_admin=True, is_advsvc=True)
|
||||
|
||||
def test_get_quota_usage_by_resource(self):
|
||||
self._create_quota_usage('goals', 26)
|
||||
|
@ -3749,7 +3749,7 @@ class TestSubnetsV2(NeutronDbPluginV2TestCase):
|
||||
def _test_validate_subnet_ipv6_pd_modes(self, cur_subnet=None,
|
||||
expect_success=True, **modes):
|
||||
plugin = manager.NeutronManager.get_plugin()
|
||||
ctx = context.get_admin_context(load_admin_roles=False)
|
||||
ctx = context.get_admin_context()
|
||||
new_subnet = {'ip_version': 6,
|
||||
'cidr': constants.PROVISIONAL_IPV6_PD_PREFIX,
|
||||
'enable_dhcp': True,
|
||||
|
@ -348,7 +348,7 @@ class QuotaExtensionDbTestCase(QuotaExtensionTestCase):
|
||||
tenant_id = 'tenant_id1'
|
||||
self.assertRaises(exceptions.QuotaResourceUnknown,
|
||||
quota.QUOTAS.make_reservation,
|
||||
context.get_admin_context(load_admin_roles=False),
|
||||
context.get_admin_context(),
|
||||
tenant_id,
|
||||
{'foobar': 1},
|
||||
plugin=None)
|
||||
@ -357,7 +357,7 @@ class QuotaExtensionDbTestCase(QuotaExtensionTestCase):
|
||||
tenant_id = 'tenant_id1'
|
||||
self.assertRaises(exceptions.InvalidQuotaValue,
|
||||
quota.QUOTAS.make_reservation,
|
||||
context.get_admin_context(load_admin_roles=False),
|
||||
context.get_admin_context(),
|
||||
tenant_id,
|
||||
{'network': -1},
|
||||
plugin=None)
|
||||
|
Loading…
Reference in New Issue
Block a user