summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavanum Srinivas (dims) <davanum@gmail.com>2015-12-10 15:18:39 +0000
committerDavanum Srinivas <davanum@gmail.com>2015-12-10 19:52:44 +0300
commitce6ca042806dc09b33d30c56dac88e01d2ea24ec (patch)
tree345d62a0ce3d9c2f4191be3b364be9648d9b5c82
parent5c06fa6ea71cf9cd6526c1469dc6e12ab80a3fa1 (diff)
downloadoslo-middleware-ce6ca042806dc09b33d30c56dac88e01d2ea24ec.tar.gz
Re-Add oslo.middleware namespace for backward compat3.2.0
Short Story: If we don't do this then we have to drop, assert:support-upgrade from nova (Really Really Bad!) Longer Story: We need to support kilo paste-ini until liberty-eol per policies already in place. To do that an alternative would have been to cap global-requirements, but that got ruled out, please see work and reasons here: I5731b0278e266699fe716733b6dd4f7238a35586 There's also another new spec openstack-specs that is gathering a lot of positive votes regarding backward compat: I72e4e9cfa0539f6b326a0296c065fa3cb754f8ae Note that this is not a straight revert of: I1479f37f500a358cdf7ad416f0257288b65c9245 As i just want to drop the tests and keep the files to a minimum. The grenade job is enough to test the older scenario (which was failing) which we need to support. Change-Id: I04739bc3987786b4bc1fefc70fabaa69b3de52b4 Closes-Bug: 1524404
-rw-r--r--oslo/__init__.py13
-rw-r--r--oslo/middleware/__init__.py42
-rw-r--r--setup.cfg4
3 files changed, 59 insertions, 0 deletions
diff --git a/oslo/__init__.py b/oslo/__init__.py
new file mode 100644
index 0000000..dc130d6
--- /dev/null
+++ b/oslo/__init__.py
@@ -0,0 +1,13 @@
+# Licensed under the Apache License, Version 2.0 (the "License"); you may
+# not use this file except in compliance with the License. You may obtain
+# a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+# License for the specific language governing permissions and limitations
+# under the License.
+
+__import__('pkg_resources').declare_namespace(__name__)
diff --git a/oslo/middleware/__init__.py b/oslo/middleware/__init__.py
new file mode 100644
index 0000000..fae2394
--- /dev/null
+++ b/oslo/middleware/__init__.py
@@ -0,0 +1,42 @@
+# Licensed under the Apache License, Version 2.0 (the "License"); you may
+# not use this file except in compliance with the License. You may obtain
+# a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+# License for the specific language governing permissions and limitations
+# under the License.
+
+import sys
+import warnings
+
+def deprecated():
+ new_name = __name__.replace('.', '_')
+ warnings.warn(
+ ('The oslo namespace package is deprecated. Please use %s instead.' %
+ new_name),
+ DeprecationWarning,
+ stacklevel=3,
+ )
+
+
+# NOTE(dims): We cannot remove the deprecation or redirects below
+# until Liberty-EOL
+deprecated()
+
+from oslo_middleware import base
+from oslo_middleware import catch_errors
+from oslo_middleware import correlation_id
+from oslo_middleware import debug
+from oslo_middleware import request_id
+from oslo_middleware import sizelimit
+
+sys.modules['oslo.middleware.base'] = base
+sys.modules['oslo.middleware.catch_errors'] = catch_errors
+sys.modules['oslo.middleware.correlation_id'] = correlation_id
+sys.modules['oslo.middleware.debug'] = debug
+sys.modules['oslo.middleware.request_id'] = request_id
+sys.modules['oslo.middleware.sizelimit'] = sizelimit \ No newline at end of file
diff --git a/setup.cfg b/setup.cfg
index f006941..599d296 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -20,7 +20,11 @@ classifier =
[files]
packages =
+ oslo
+ oslo.middleware
oslo_middleware
+namespace_packages =
+ oslo
[entry_points]
oslo.config.opts =