From 3d7a26bdec7b3a41090b6b092025ab5cd8f87b24 Mon Sep 17 00:00:00 2001 From: Tom Cocozzello Date: Tue, 23 Feb 2016 11:02:08 -0600 Subject: [PATCH] Defaults are ignored with flake8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit If “ignore” is not set under flake8 in the tox.ini file there there are defaults set to be ignored. The depended patch fixes many of the problems. Change-Id: Ieed2fe1c4654e201d3fe6d40ef93e247ee736f8b Doc: http://flake8.readthedocs.org/en/latest/config.html#default Depends-On: I935ab48e7c5bac5f88ecdb3a05f73fb44fc9f41d Closes-Bug: #1548910 --- functional/tests/compute/v2/test_server.py | 6 +++--- functional/tests/identity/v3/test_group.py | 2 +- openstackclient/common/timing.py | 3 ++- openstackclient/compute/v2/server.py | 2 +- tox.ini | 3 +++ 5 files changed, 10 insertions(+), 6 deletions(-) diff --git a/functional/tests/compute/v2/test_server.py b/functional/tests/compute/v2/test_server.py index bd1b2a876b..6c09a42e02 100644 --- a/functional/tests/compute/v2/test_server.py +++ b/functional/tests/compute/v2/test_server.py @@ -32,14 +32,14 @@ class ServerTests(test.TestCase): def get_flavor(cls): raw_output = cls.openstack('flavor list -f value -c ID') ray = raw_output.split('\n') - idx = int(len(ray)/2) + idx = int(len(ray) / 2) return ray[idx] @classmethod def get_image(cls): raw_output = cls.openstack('image list -f value -c ID') ray = raw_output.split('\n') - idx = int(len(ray)/2) + idx = int(len(ray) / 2) return ray[idx] @classmethod @@ -49,7 +49,7 @@ class ServerTests(test.TestCase): except exceptions.CommandFailed: return '' ray = raw_output.split('\n') - idx = int(len(ray)/2) + idx = int(len(ray) / 2) return ' --nic net-id=' + ray[idx] @classmethod diff --git a/functional/tests/identity/v3/test_group.py b/functional/tests/identity/v3/test_group.py index 2d7f8f383f..8e39cd5daa 100644 --- a/functional/tests/identity/v3/test_group.py +++ b/functional/tests/identity/v3/test_group.py @@ -131,7 +131,7 @@ class GroupTests(test_identity.IdentityTests): '%(group)s %(user)s' % {'group_domain': self.domain_name, 'user_domain': self.domain_name, 'group': group_name, - 'user': username}) + 'user': username}) self.assertOutput( '%(user)s in group %(group)s\n' % {'user': username, 'group': group_name}, diff --git a/openstackclient/common/timing.py b/openstackclient/common/timing.py index 5f62875947..71c2fec7e7 100644 --- a/openstackclient/common/timing.py +++ b/openstackclient/common/timing.py @@ -30,7 +30,8 @@ class Timing(command.Lister): for url, td in self.app.timing_data: # NOTE(dtroyer): Take the long way here because total_seconds() # was added in py27. - sec = (td.microseconds + (td.seconds + td.days*86400) * 1e6) / 1e6 + sec = (td.microseconds + (td.seconds + td.days * + 86400) * 1e6) / 1e6 total += sec results.append((url, sec)) results.append(('Total', total)) diff --git a/openstackclient/compute/v2/server.py b/openstackclient/compute/v2/server.py index 4cb94822bd..ca239c5195 100644 --- a/openstackclient/compute/v2/server.py +++ b/openstackclient/compute/v2/server.py @@ -1206,7 +1206,7 @@ class RescueServer(command.ShowOne): _, body = utils.find_resource( compute_client.servers, parsed_args.server, - ).rescue() + ).rescue() return zip(*sorted(six.iteritems(body))) diff --git a/tox.ini b/tox.ini index cc1407f45c..d2a3f3d321 100644 --- a/tox.ini +++ b/tox.ini @@ -36,3 +36,6 @@ commands = sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasen [flake8] show-source = True exclude = .git,.tox,dist,doc,*openstack/common*,*lib/python*,*egg,build,tools +# If 'ignore' is not set there are default errors and warnings that are set +# Doc: http://flake8.readthedocs.org/en/latest/config.html#default +ignore = __ \ No newline at end of file