From 37a83c1edeb3dc421a09232fe21fc9fed9d5cef3 Mon Sep 17 00:00:00 2001 From: Andreas Jaeger Date: Thu, 30 Apr 2020 16:42:53 +0200 Subject: [PATCH] pep8: Enable E226 Enable "E226 missing whitespace around arithmetic operator" And fix problems encountered. Change-Id: I90cbf6220f487a0808e13cd3998c8127be563498 --- heat/engine/resource.py | 2 +- heat/tests/openstack/heat/test_remote_stack.py | 4 ++-- heat_integrationtests/functional/test_heat_autoscaling.py | 4 ++-- tox.ini | 3 +-- 4 files changed, 6 insertions(+), 7 deletions(-) diff --git a/heat/engine/resource.py b/heat/engine/resource.py index 31e9ca03a0..07fbef8fba 100644 --- a/heat/engine/resource.py +++ b/heat/engine/resource.py @@ -2036,7 +2036,7 @@ class Resource(status.ResourceStatus): while True: count += 1 LOG.info('delete %(name)s attempt %(attempt)d' % - {'name': str(self), 'attempt': count+1}) + {'name': str(self), 'attempt': count + 1}) if count: delay = timeutils.retry_backoff_delay(count, jitter_max=2.0) diff --git a/heat/tests/openstack/heat/test_remote_stack.py b/heat/tests/openstack/heat/test_remote_stack.py index 69a10a2283..f4051efb07 100644 --- a/heat/tests/openstack/heat/test_remote_stack.py +++ b/heat/tests/openstack/heat/test_remote_stack.py @@ -351,13 +351,13 @@ class RemoteStackTest(tests_common.HeatTestCase): ks_loading, 'get_plugin_loader', return_value=self.m_plugin) self._create_with_remote_credential('cred_2') self.assertEqual( - [mock.call(secret_ref='secrets/cred_2')]*2, + [mock.call(secret_ref='secrets/cred_2')] * 2, m_gsbr.call_args_list) expected_load_options = [ mock.call( application_credential_id='9dfa187e5a354484bf9c49a2b674333a', application_credential_secret='sec', - auth_url='http://192.168.1.101/identity/v3')]*2 + auth_url='http://192.168.1.101/identity/v3')] * 2 self.assertEqual(expected_load_options, self.m_plugin.load_from_options.call_args_list) diff --git a/heat_integrationtests/functional/test_heat_autoscaling.py b/heat_integrationtests/functional/test_heat_autoscaling.py index cd1c9c73ca..8d7fa69777 100644 --- a/heat_integrationtests/functional/test_heat_autoscaling.py +++ b/heat_integrationtests/functional/test_heat_autoscaling.py @@ -111,7 +111,7 @@ outputs: # send scale up signals and ensure that asg honors max_size asg = self.client.resources.get(stack_id, 'random_group') max_size = 5 - for num in range(asg_size+1, max_size+2): + for num in range(asg_size + 1, max_size + 2): expected_resources = num if num <= max_size else max_size self.client.resources.signal(stack_id, 'scale_up_policy') self.assertTrue( @@ -133,7 +133,7 @@ outputs: # send scale down signals and ensure that asg honors min_size asg = self.client.resources.get(stack_id, 'random_group') min_size = 2 - for num in range(asg_size-1, 0, -1): + for num in range(asg_size - 1, 0, -1): expected_resources = num if num >= min_size else min_size self.client.resources.signal(stack_id, 'scale_down_policy') self.assertTrue( diff --git a/tox.ini b/tox.ini index c3bbca5ff3..5fac60ce30 100644 --- a/tox.ini +++ b/tox.ini @@ -109,10 +109,9 @@ commands = bandit -r heat -x tests --skip B101,B104,B107,B110,B310,B311,B404,B41 [flake8] show-source = true # E123 closing bracket does not match indentation of opening bracket's line -# E226 missing whitespace around arithmetic operator # W503 line break before binary operator # W504 line break after binary operator -ignore = E123,E226,W503,W504 +ignore = E123,W503,W504 exclude=.*,dist,*lib/python*,*egg,build,*convergence/scenarios/* max-complexity=23