Fix a few minor annoyances that snuck in

We had the normal infra pep8 ignores marked, but follow some of them by hand
in this codebase anyway. While E12* are not valid pep8, the prevailing style
of shade is in agreement with them. While we weren't enforcing them, a few
instances snuck in. Fix them and just turn the flags on.

Change-Id: Iea2bd9a99eb8b20dd40418ac8479b809d3872de8
This commit is contained in:
Monty Taylor 2017-03-15 18:06:28 +01:00
parent 8aa8688ba8
commit c9e9ef9f43
No known key found for this signature in database
GPG Key ID: 7BAE94BC7141A594
7 changed files with 16 additions and 19 deletions

View File

@ -2121,8 +2121,7 @@ class OpenStackCloud(_normalize.Normalizer):
external_ipv4_networks.append(network)
# External Floating IPv4 networks
if ('router:external' in network
and network['router:external']):
if ('router:external' in network and network['router:external']):
external_ipv4_floating_networks.append(network)
# Internal networks
@ -5998,7 +5997,8 @@ class OpenStackCloud(_normalize.Normalizer):
entry['etag'] = result.headers['Etag']
def _upload_large_object(
self, endpoint, filename, headers, file_size, segment_size, use_slo):
self, endpoint, filename,
headers, file_size, segment_size, use_slo):
# If the object is big, we need to break it up into segments that
# are no larger than segment_size, upload each of them individually
# and then upload a manifest object. The segments can be uploaded in

View File

@ -103,8 +103,8 @@ class TestEndpoints(base.BaseFunctionalTestCase):
self.assertIsNotNone(endpoints[0].get('id'))
def test_update_endpoint(self):
if self.operator_cloud.cloud_config.get_api_version(
'identity').startswith('2'):
ver = self.operator_cloud.cloud_config.get_api_version('identity')
if ver.startswith('2'):
# NOTE(SamYaple): Update endpoint only works with v3 api
self.assertRaises(OpenStackCloudUnavailableFeature,
self.operator_cloud.update_endpoint,

View File

@ -66,8 +66,7 @@ class TestObject(base.BaseFunctionalTestCase):
self.assertFalse(self.user_cloud.is_object_stale(
container_name, name,
fake_file.name
)
)
))
self.assertEqual(
'bar', self.user_cloud.get_object_metadata(
container_name, name)['x-object-meta-foo']
@ -131,8 +130,7 @@ class TestObject(base.BaseFunctionalTestCase):
self.assertFalse(self.user_cloud.is_object_stale(
container_name, name,
fake_file.name
)
)
))
self.assertEqual(
'bar', self.user_cloud.get_object_metadata(
container_name, name)['x-object-meta-foo']

View File

@ -65,8 +65,8 @@ class TestServices(base.BaseFunctionalTestCase):
self.assertIsNotNone(service.get('id'))
def test_update_service(self):
if self.operator_cloud.cloud_config.get_api_version(
'identity').startswith('2'):
ver = self.operator_cloud.cloud_config.get_api_version('identity')
if ver.startswith('2'):
# NOTE(SamYaple): Update service only works with v3 api
self.assertRaises(OpenStackCloudUnavailableFeature,
self.operator_cloud.update_service,

View File

@ -67,10 +67,9 @@ commands = python setup.py build_sphinx
commands = sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html
[flake8]
# Infra does not follow hacking, nor the broken E12* things
# The string of H ignores is because there are some useful checks
# related to python3 compat.
ignore = E123,E125,E129,H3,H4,H5,H6,H7,H8,H103,H201,H238
ignore = H3,H4,H5,H6,H7,H8,H103,H201,H238
show-source = True
builtins = _
exclude=.venv,.git,.tox,dist,doc,*lib/python*,*egg,build