From c3c09ad38f74f720af647330842478c764630d86 Mon Sep 17 00:00:00 2001 From: Chmouel Boudjnah Date: Sun, 21 Apr 2013 06:34:22 +0200 Subject: [PATCH] Fix flake8 gating in tox. - based on https://review.openstack.org/#/c/26327/. - fix the remaining violations. --- swsync/filler.py | 2 +- swsync/objects.py | 2 +- tests/functional/test_middleware_lm.py | 2 +- tox.ini | 7 ++++++- 4 files changed, 9 insertions(+), 4 deletions(-) diff --git a/swsync/filler.py b/swsync/filler.py index 049eff6..f5407dc 100644 --- a/swsync/filler.py +++ b/swsync/filler.py @@ -206,7 +206,7 @@ def create_objects(cnx, acc, o_amount, fmax, index_containers): "(filename: %s,\tsize: %.3f KB)" % (container, object_name.encode('ascii', 'ignore'), - float(len(data))/1024)) + float(len(data)) / 1024)) obj_info = {'object_info': (object_name, etag, len(data)), 'meta': meta} containers_d[container]['objects'].append(obj_info) diff --git a/swsync/objects.py b/swsync/objects.py index 1e23091..60bcfe1 100644 --- a/swsync/objects.py +++ b/swsync/objects.py @@ -60,7 +60,7 @@ def get_object(storage_url, token, if not swift.common.http.is_success(resp.status): resp.read() - #TODO: logging + # TODO(chmou): logging raise swiftclient.ClientException( 'status %s %s' % (resp.status, resp.reason)) diff --git a/tests/functional/test_middleware_lm.py b/tests/functional/test_middleware_lm.py index 9c58767..eca05e9 100644 --- a/tests/functional/test_middleware_lm.py +++ b/tests/functional/test_middleware_lm.py @@ -20,8 +20,8 @@ # Last-Modified middleware must be installed in the proxy-server # pipeline. -import unittest import swiftclient +import unittest CONF = { 'user': ('demo:demo', 'wxcvbn'), diff --git a/tox.ini b/tox.ini index 16f5d14..a5bb3d7 100644 --- a/tox.ini +++ b/tox.ini @@ -15,7 +15,7 @@ deps = -r{toxinidir}/tools/pip-requires commands = python setup.py testr --testr-args="{posargs}" [testenv:flake8] -deps = flake8 +sitepackages = False commands = flake8 --show-source swsync bin setup.py tests [testenv:venv] @@ -26,3 +26,8 @@ commands = python setup.py testr --coverage [tox:jenkins] downloadcache = ~/cache/pip + +[flake8] +ignore = E12,E711,E721,E712,H302,H303,H403,H404,F +builtins = _ +exclude = .venv,.git,.tox,dist,doc,*openstack/common*,*lib/python*,*egg,build,plugins,tools