summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--oslo_middleware/base.py11
-rw-r--r--oslo_middleware/cors.py4
-rw-r--r--oslo_middleware/opts.py18
-rw-r--r--test-requirements.txt2
4 files changed, 16 insertions, 19 deletions
diff --git a/oslo_middleware/base.py b/oslo_middleware/base.py
index ed2e3bb..29d32e1 100644
--- a/oslo_middleware/base.py
+++ b/oslo_middleware/base.py
@@ -17,16 +17,15 @@
import six
-if six.PY2:
- from inspect import getargspec as getfullargspec
-else:
- from inspect import getfullargspec
-
+from oslo_config import cfg
import webob.dec
import webob.request
import webob.response
-from oslo_config import cfg
+if six.PY2:
+ from inspect import getargspec as getfullargspec
+else:
+ from inspect import getfullargspec
class NoContentTypeResponse(webob.response.Response):
diff --git a/oslo_middleware/cors.py b/oslo_middleware/cors.py
index f5982b4..17ff6d0 100644
--- a/oslo_middleware/cors.py
+++ b/oslo_middleware/cors.py
@@ -140,8 +140,8 @@ class CORS(base.ConfigurableMiddleware):
allow_methods: List of HTTP methods to permit.
allow_headers: List of HTTP headers to permit from the client.
"""
- if ('allowed_origin' not in local_conf
- and 'oslo_config_project' not in local_conf):
+ if ('allowed_origin' not in local_conf and
+ 'oslo_config_project' not in local_conf):
raise TypeError("allowed_origin or oslo_config_project "
"is required")
return super(CORS, cls).factory(global_conf, **local_conf)
diff --git a/oslo_middleware/opts.py b/oslo_middleware/opts.py
index 6cf6f4d..734c21f 100644
--- a/oslo_middleware/opts.py
+++ b/oslo_middleware/opts.py
@@ -12,6 +12,14 @@
# License for the specific language governing permissions and limitations
# under the License.
+import copy
+import itertools
+
+from oslo_middleware import cors
+from oslo_middleware.healthcheck import opts as healthcheck_opts
+from oslo_middleware import http_proxy_to_wsgi
+from oslo_middleware import sizelimit
+from oslo_middleware import ssl
__all__ = [
'list_opts',
@@ -23,16 +31,6 @@ __all__ = [
]
-import copy
-import itertools
-
-from oslo_middleware import cors
-from oslo_middleware.healthcheck import opts as healthcheck_opts
-from oslo_middleware import http_proxy_to_wsgi
-from oslo_middleware import sizelimit
-from oslo_middleware import ssl
-
-
def list_opts():
"""Return a list of oslo.config options for ALL of the middleware classes.
diff --git a/test-requirements.txt b/test-requirements.txt
index 9e062a9..8cbddcd 100644
--- a/test-requirements.txt
+++ b/test-requirements.txt
@@ -3,7 +3,7 @@
# process, which may cause wedges in the gate later.
fixtures>=3.0.0 # Apache-2.0/BSD
-hacking!=0.13.0,<0.14,>=0.12.0 # Apache-2.0
+hacking>=1.1.0,<1.2.0 # Apache-2.0
mock>=2.0.0 # BSD
oslotest>=3.2.0 # Apache-2.0
testtools>=2.2.0 # MIT