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:
Ihar Hrachyshka 2015-10-01 16:28:26 +02:00
parent 75ec30f650
commit 0396b3de79
4 changed files with 7 additions and 14 deletions

View File

@ -18,7 +18,6 @@
import copy import copy
import datetime import datetime
from debtcollector import removals
from oslo_context import context as oslo_context from oslo_context import context as oslo_context
from oslo_log import log as logging 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, def __init__(self, user_id, tenant_id, is_admin=None, roles=None,
timestamp=None, request_id=None, tenant_name=None, timestamp=None, request_id=None, tenant_name=None,
user_name=None, overwrite=True, auth_token=None, user_name=None, overwrite=True, auth_token=None,
@ -105,8 +103,7 @@ class ContextBase(oslo_context.RequestContext):
def from_dict(cls, values): def from_dict(cls, values):
return cls(**values) return cls(**values)
@removals.removed_kwarg('read_deleted') def elevated(self):
def elevated(self, read_deleted=None):
"""Return a version of this context with admin flag set.""" """Return a version of this context with admin flag set."""
context = copy.copy(self) context = copy.copy(self)
context.is_admin = True context.is_admin = True
@ -129,17 +126,14 @@ class Context(ContextBase):
return self._session return self._session
@removals.removed_kwarg('read_deleted') def get_admin_context():
@removals.removed_kwarg('load_admin_roles')
def get_admin_context(read_deleted="no", load_admin_roles=True):
return Context(user_id=None, return Context(user_id=None,
tenant_id=None, tenant_id=None,
is_admin=True, is_admin=True,
overwrite=False) overwrite=False)
@removals.removed_kwarg('read_deleted') def get_admin_context_without_session():
def get_admin_context_without_session(read_deleted="no"):
return ContextBase(user_id=None, return ContextBase(user_id=None,
tenant_id=None, tenant_id=None,
is_admin=True) is_admin=True)

View File

@ -303,8 +303,7 @@ class TestQuotaDbApiAdminContext(TestQuotaDbApi):
def _set_context(self): def _set_context(self):
self.tenant_id = 'Higuain' self.tenant_id = 'Higuain'
self.context = context.Context('Gonzalo', self.tenant_id, self.context = context.Context('Gonzalo', self.tenant_id,
is_admin=True, is_advsvc=True, is_admin=True, is_advsvc=True)
load_admin_roles=False)
def test_get_quota_usage_by_resource(self): def test_get_quota_usage_by_resource(self):
self._create_quota_usage('goals', 26) self._create_quota_usage('goals', 26)

View File

@ -3749,7 +3749,7 @@ class TestSubnetsV2(NeutronDbPluginV2TestCase):
def _test_validate_subnet_ipv6_pd_modes(self, cur_subnet=None, def _test_validate_subnet_ipv6_pd_modes(self, cur_subnet=None,
expect_success=True, **modes): expect_success=True, **modes):
plugin = manager.NeutronManager.get_plugin() plugin = manager.NeutronManager.get_plugin()
ctx = context.get_admin_context(load_admin_roles=False) ctx = context.get_admin_context()
new_subnet = {'ip_version': 6, new_subnet = {'ip_version': 6,
'cidr': constants.PROVISIONAL_IPV6_PD_PREFIX, 'cidr': constants.PROVISIONAL_IPV6_PD_PREFIX,
'enable_dhcp': True, 'enable_dhcp': True,

View File

@ -348,7 +348,7 @@ class QuotaExtensionDbTestCase(QuotaExtensionTestCase):
tenant_id = 'tenant_id1' tenant_id = 'tenant_id1'
self.assertRaises(exceptions.QuotaResourceUnknown, self.assertRaises(exceptions.QuotaResourceUnknown,
quota.QUOTAS.make_reservation, quota.QUOTAS.make_reservation,
context.get_admin_context(load_admin_roles=False), context.get_admin_context(),
tenant_id, tenant_id,
{'foobar': 1}, {'foobar': 1},
plugin=None) plugin=None)
@ -357,7 +357,7 @@ class QuotaExtensionDbTestCase(QuotaExtensionTestCase):
tenant_id = 'tenant_id1' tenant_id = 'tenant_id1'
self.assertRaises(exceptions.InvalidQuotaValue, self.assertRaises(exceptions.InvalidQuotaValue,
quota.QUOTAS.make_reservation, quota.QUOTAS.make_reservation,
context.get_admin_context(load_admin_roles=False), context.get_admin_context(),
tenant_id, tenant_id,
{'network': -1}, {'network': -1},
plugin=None) plugin=None)