Browse Source

Merge "Revert "Postpone deprecation warnings to Pike""

Jenkins 1 year ago
parent
commit
ba3307845b
2 changed files with 10 additions and 20 deletions
  1. 5
    10
      oslo_context/context.py
  2. 5
    10
      oslo_context/tests/test_context.py

+ 5
- 10
oslo_context/context.py View File

@@ -34,6 +34,7 @@ import warnings
34 34
 
35 35
 import debtcollector
36 36
 
37
+
37 38
 _request_store = threading.local()
38 39
 
39 40
 # These arguments will be passed to a new context from the first available
@@ -130,22 +131,16 @@ class _DeprecatedPolicyValues(collections.MutableMapping):
130 131
         return d
131 132
 
132 133
 
133
-# FIXME(dims): Skip deprecation warnings until Pike (Version 2.14)
134
-_log_deprecation_warnings = False
135
-
136
-
137 134
 def _moved_msg(new_name, old_name):
138 135
     if old_name:
139 136
         deprecated_msg = "Property '%(old_name)s' has moved to '%(new_name)s'"
140 137
         deprecated_msg = deprecated_msg % {'old_name': old_name,
141 138
                                            'new_name': new_name}
142 139
 
143
-        # FIXME(dims): Skip deprecation warnings until Pike (Version 2.14)
144
-        if _log_deprecation_warnings:
145
-            debtcollector.deprecate(deprecated_msg,
146
-                                    version='2.6',
147
-                                    removal_version='3.0',
148
-                                    stacklevel=5)
140
+        debtcollector.deprecate(deprecated_msg,
141
+                                version='2.6',
142
+                                removal_version='3.0',
143
+                                stacklevel=5)
149 144
 
150 145
 
151 146
 def _moved_property(new_name, old_name=None, target=None):

+ 5
- 10
oslo_context/tests/test_context.py View File

@@ -613,17 +613,12 @@ class ContextTest(test_base.BaseTestCase):
613 613
 
614 614
         self.assertEqual(0, len(self.warnings))
615 615
         self.assertEqual(user, ctx.user)
616
-        if context._log_deprecation_warnings:
617
-            self.assertEqual(1, len(self.warnings))
616
+        self.assertEqual(1, len(self.warnings))
618 617
         self.assertEqual(tenant, ctx.tenant)
619
-        if context._log_deprecation_warnings:
620
-            self.assertEqual(2, len(self.warnings))
618
+        self.assertEqual(2, len(self.warnings))
621 619
         self.assertEqual(domain, ctx.domain)
622
-        if context._log_deprecation_warnings:
623
-            self.assertEqual(3, len(self.warnings))
620
+        self.assertEqual(3, len(self.warnings))
624 621
         self.assertEqual(user_domain, ctx.user_domain)
625
-        if context._log_deprecation_warnings:
626
-            self.assertEqual(4, len(self.warnings))
622
+        self.assertEqual(4, len(self.warnings))
627 623
         self.assertEqual(project_domain, ctx.project_domain)
628
-        if context._log_deprecation_warnings:
629
-            self.assertEqual(5, len(self.warnings))
624
+        self.assertEqual(5, len(self.warnings))

Loading…
Cancel
Save