tox: add support for pylint
This also fixes a bug detected by pylint. Change-Id: I378c5766d375d72db3d58581bcee6b3d02c0352b
This commit is contained in:
parent
1f87522631
commit
32d8f7fbe8
@ -313,9 +313,10 @@ class Controller(object):
|
|||||||
"""
|
"""
|
||||||
Base WSGI controller class for the middleware
|
Base WSGI controller class for the middleware
|
||||||
"""
|
"""
|
||||||
def __init__(self, req, app, account_name, token, container_name=None,
|
def __init__(self, req, app, account_name, token, conf,
|
||||||
object_name=None, **kwargs):
|
container_name=None, object_name=None, **kwargs):
|
||||||
self.app = app
|
self.app = app
|
||||||
|
self.conf = conf
|
||||||
self.account_name = account_name
|
self.account_name = account_name
|
||||||
self.container_name = container_name
|
self.container_name = container_name
|
||||||
self.object_name = object_name
|
self.object_name = object_name
|
||||||
@ -739,8 +740,8 @@ class LocationController(Controller):
|
|||||||
return get_err_response('InternalError')
|
return get_err_response('InternalError')
|
||||||
|
|
||||||
elem = Element('LocationConstraint')
|
elem = Element('LocationConstraint')
|
||||||
if self.location != 'US':
|
if self.conf['location'] != 'US':
|
||||||
elem.text = self.location
|
elem.text = self.conf['location']
|
||||||
body = tostring(elem, xml_declaration=True, encoding='UTF-8')
|
body = tostring(elem, xml_declaration=True, encoding='UTF-8')
|
||||||
|
|
||||||
return HTTPOk(body=body, content_type='application/xml')
|
return HTTPOk(body=body, content_type='application/xml')
|
||||||
@ -1058,7 +1059,7 @@ class Swift3Middleware(object):
|
|||||||
|
|
||||||
token = base64.urlsafe_b64encode(canonical_string(req))
|
token = base64.urlsafe_b64encode(canonical_string(req))
|
||||||
|
|
||||||
controller = controller(req, self.app, account, token, conf=self.conf,
|
controller = controller(req, self.app, account, token, self.conf,
|
||||||
**path_parts)
|
**path_parts)
|
||||||
|
|
||||||
if hasattr(controller, req.method):
|
if hasattr(controller, req.method):
|
||||||
|
@ -3,3 +3,4 @@ sphinx
|
|||||||
nose
|
nose
|
||||||
openstack.nose_plugin
|
openstack.nose_plugin
|
||||||
coverage
|
coverage
|
||||||
|
pylint
|
||||||
|
5
tox.ini
5
tox.ini
@ -1,5 +1,5 @@
|
|||||||
[tox]
|
[tox]
|
||||||
envlist = py26,py27,pep8
|
envlist = py26,py27,pylint,pep8
|
||||||
minversion = 1.6
|
minversion = 1.6
|
||||||
skipsdist = True
|
skipsdist = True
|
||||||
|
|
||||||
@ -20,6 +20,9 @@ setenv = VIRTUAL_ENV={envdir}
|
|||||||
NOSE_WITH_COVERAGE=1
|
NOSE_WITH_COVERAGE=1
|
||||||
NOSE_COVER_BRANCHES=1
|
NOSE_COVER_BRANCHES=1
|
||||||
|
|
||||||
|
[testenv:pylint]
|
||||||
|
commands = pylint -E swift3
|
||||||
|
|
||||||
[testenv:pep8]
|
[testenv:pep8]
|
||||||
commands = flake8
|
commands = flake8
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user