Clean imports in code
This patch set modifies lines which are importing objects instead of modules. As per openstack import guide lines, user should import modules in a file not objects. http://docs.openstack.org/developer/hacking/#imports Change-Id: I6624bc15c64e4e31e6988c60e40fdfa6ab1488fb
This commit is contained in:
parent
d2ad33f07c
commit
9f5b518150
@ -15,7 +15,7 @@
|
|||||||
|
|
||||||
"""wsgi transport helpers."""
|
"""wsgi transport helpers."""
|
||||||
|
|
||||||
from distutils.version import LooseVersion
|
from distutils import version
|
||||||
import uuid
|
import uuid
|
||||||
|
|
||||||
import falcon
|
import falcon
|
||||||
@ -103,8 +103,9 @@ def extract_project_id(req, resp, params):
|
|||||||
u'string. Specify the right header '
|
u'string. Specify the right header '
|
||||||
u'X-PROJECT-ID and retry.'))
|
u'X-PROJECT-ID and retry.'))
|
||||||
|
|
||||||
api_version = LooseVersion(api_version_string)
|
api_version = version.LooseVersion(api_version_string)
|
||||||
if not params['project_id'] and api_version >= LooseVersion('v1.1'):
|
if (not params['project_id'] and api_version >=
|
||||||
|
version.LooseVersion('v1.1')):
|
||||||
raise falcon.HTTPBadRequest('Project-Id Missing',
|
raise falcon.HTTPBadRequest('Project-Id Missing',
|
||||||
_(u'The header X-PROJECT-ID was missing'))
|
_(u'The header X-PROJECT-ID was missing'))
|
||||||
|
|
||||||
|
@ -13,7 +13,7 @@
|
|||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
from distutils.version import LooseVersion
|
from distutils import version as d_version
|
||||||
from wsgiref import simple_server
|
from wsgiref import simple_server
|
||||||
|
|
||||||
import falcon
|
import falcon
|
||||||
@ -121,7 +121,8 @@ class Driver(transport.DriverBase):
|
|||||||
# middleware instead of it, but for the compatibility with old version,
|
# middleware instead of it, but for the compatibility with old version,
|
||||||
# we support them both now. Hook way can be removed after falcon
|
# we support them both now. Hook way can be removed after falcon
|
||||||
# version must be bigger than 1.0.0 in requirements.
|
# version must be bigger than 1.0.0 in requirements.
|
||||||
if LooseVersion(falcon.__version__) >= LooseVersion("1.0.0"):
|
if (d_version.LooseVersion(falcon.__version__) >=
|
||||||
|
d_version.LooseVersion("1.0.0")):
|
||||||
middleware = [FuncMiddleware(hook) for hook in self.before_hooks]
|
middleware = [FuncMiddleware(hook) for hook in self.before_hooks]
|
||||||
self.app = falcon.API(middleware=middleware)
|
self.app = falcon.API(middleware=middleware)
|
||||||
else:
|
else:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user