pep8: Enable E226

Enable
"E226 missing whitespace around arithmetic operator"

And fix problems encountered.

Change-Id: I90cbf6220f487a0808e13cd3998c8127be563498
This commit is contained in:
Andreas Jaeger 2020-04-30 16:42:53 +02:00
parent 7f770b95b8
commit 37a83c1ede
4 changed files with 6 additions and 7 deletions

View File

@ -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)

View File

@ -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)

View File

@ -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(

View File

@ -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