Revert "Postpone deprecation warnings to Pike"
This reverts commit 96432cbe4d
.
it helps us a lot in Ocata, need open the deprecation warnings
to make consuming projects move to fix the warning.
Change-Id: I10874c66bfd7c7f582a4fe91dcb6354f1c55fc04
This commit is contained in:
parent
b1bbc6906c
commit
7a91ceed4e
|
@ -35,6 +35,7 @@ import warnings
|
|||
import debtcollector
|
||||
from positional import positional
|
||||
|
||||
|
||||
_request_store = threading.local()
|
||||
|
||||
# These arguments will be passed to a new context from the first available
|
||||
|
@ -131,22 +132,16 @@ class _DeprecatedPolicyValues(collections.MutableMapping):
|
|||
return d
|
||||
|
||||
|
||||
# FIXME(dims): Skip deprecation warnings until Pike (Version 2.14)
|
||||
_log_deprecation_warnings = False
|
||||
|
||||
|
||||
def _moved_msg(new_name, old_name):
|
||||
if old_name:
|
||||
deprecated_msg = "Property '%(old_name)s' has moved to '%(new_name)s'"
|
||||
deprecated_msg = deprecated_msg % {'old_name': old_name,
|
||||
'new_name': new_name}
|
||||
|
||||
# FIXME(dims): Skip deprecation warnings until Pike (Version 2.14)
|
||||
if _log_deprecation_warnings:
|
||||
debtcollector.deprecate(deprecated_msg,
|
||||
version='2.6',
|
||||
removal_version='3.0',
|
||||
stacklevel=5)
|
||||
debtcollector.deprecate(deprecated_msg,
|
||||
version='2.6',
|
||||
removal_version='3.0',
|
||||
stacklevel=5)
|
||||
|
||||
|
||||
def _moved_property(new_name, old_name=None, target=None):
|
||||
|
|
|
@ -620,17 +620,12 @@ class ContextTest(test_base.BaseTestCase):
|
|||
|
||||
self.assertEqual(0, len(self.warnings))
|
||||
self.assertEqual(user, ctx.user)
|
||||
if context._log_deprecation_warnings:
|
||||
self.assertEqual(1, len(self.warnings))
|
||||
self.assertEqual(1, len(self.warnings))
|
||||
self.assertEqual(tenant, ctx.tenant)
|
||||
if context._log_deprecation_warnings:
|
||||
self.assertEqual(2, len(self.warnings))
|
||||
self.assertEqual(2, len(self.warnings))
|
||||
self.assertEqual(domain, ctx.domain)
|
||||
if context._log_deprecation_warnings:
|
||||
self.assertEqual(3, len(self.warnings))
|
||||
self.assertEqual(3, len(self.warnings))
|
||||
self.assertEqual(user_domain, ctx.user_domain)
|
||||
if context._log_deprecation_warnings:
|
||||
self.assertEqual(4, len(self.warnings))
|
||||
self.assertEqual(4, len(self.warnings))
|
||||
self.assertEqual(project_domain, ctx.project_domain)
|
||||
if context._log_deprecation_warnings:
|
||||
self.assertEqual(5, len(self.warnings))
|
||||
self.assertEqual(5, len(self.warnings))
|
||||
|
|
Loading…
Reference in New Issue