summaryrefslogtreecommitdiff
path: root/oslo_context
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2017-09-20 13:25:42 +0000
committerGerrit Code Review <review@openstack.org>2017-09-20 13:25:42 +0000
commitba3307845bbb145fdd4d7fc70d0075db355d0398 (patch)
tree44151aaceca9371fb8016c05c3e9546e223d5f38 /oslo_context
parent15a6c74bf5e6fb0136dda5b837c67a8ab57a6eea (diff)
parent7a91ceed4edd3733ec92a39e7cdddf02f0636ab8 (diff)
downloadoslo-context-ba3307845bbb145fdd4d7fc70d0075db355d0398.tar.gz
Merge "Revert "Postpone deprecation warnings to Pike""
Diffstat (limited to 'oslo_context')
-rw-r--r--oslo_context/context.py15
-rw-r--r--oslo_context/tests/test_context.py15
2 files changed, 10 insertions, 20 deletions
diff --git a/oslo_context/context.py b/oslo_context/context.py
index 339672e..bfbd715 100644
--- a/oslo_context/context.py
+++ b/oslo_context/context.py
@@ -34,6 +34,7 @@ import warnings
import debtcollector
+
_request_store = threading.local()
# These arguments will be passed to a new context from the first available
@@ -130,22 +131,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):
diff --git a/oslo_context/tests/test_context.py b/oslo_context/tests/test_context.py
index 3f8e811..e172ca2 100644
--- a/oslo_context/tests/test_context.py
+++ b/oslo_context/tests/test_context.py
@@ -613,17 +613,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))