From 45b525d341988b34811a6aed688ed50d5bda27ad Mon Sep 17 00:00:00 2001 From: "John L. Villalovos" Date: Thu, 19 Feb 2015 10:12:02 -0800 Subject: [PATCH] Fix PEP8 E124 & E125 errors Fix PEP8 E124 & E125 errors E124: closing bracket does not match visual indentation E125: continuation line with same indent as next logical line Remove E124 & E125 from the ignore list for flake8 Change-Id: Ia9aee2fb7e0bb6771aad11d3523119944eeb4170 --- ironic/api/controllers/v1/__init__.py | 10 +++++----- ironic/api/controllers/v1/chassis.py | 4 ++-- ironic/api/controllers/v1/node.py | 4 ++-- ironic/api/controllers/v1/port.py | 2 +- ironic/conductor/manager.py | 2 +- .../versions/3cb628139ea4_nodes_add_console_enabled.py | 2 +- ironic/drivers/modules/ilo/management.py | 2 +- ironic/drivers/modules/iscsi_deploy.py | 2 +- ironic/tests/api/utils.py | 4 ++-- ironic/tests/conductor/test_manager.py | 3 ++- ironic/tests/objects/test_objects.py | 2 +- tox.ini | 2 +- 12 files changed, 20 insertions(+), 19 deletions(-) diff --git a/ironic/api/controllers/v1/__init__.py b/ironic/api/controllers/v1/__init__.py index c12c8c5215..cd94ca0201 100644 --- a/ironic/api/controllers/v1/__init__.py +++ b/ironic/api/controllers/v1/__init__.py @@ -109,7 +109,7 @@ class V1(base.APIBase): 'developer/ironic/dev', 'api-spec-v1.html', bookmark=True, type='text/html') - ] + ] v1.media_types = [MediaType('application/json', 'application/vnd.openstack.ironic.v1+json')] v1.chassis = [link.Link.make_link('self', pecan.request.host_url, @@ -118,28 +118,28 @@ class V1(base.APIBase): pecan.request.host_url, 'chassis', '', bookmark=True) - ] + ] v1.nodes = [link.Link.make_link('self', pecan.request.host_url, 'nodes', ''), link.Link.make_link('bookmark', pecan.request.host_url, 'nodes', '', bookmark=True) - ] + ] v1.ports = [link.Link.make_link('self', pecan.request.host_url, 'ports', ''), link.Link.make_link('bookmark', pecan.request.host_url, 'ports', '', bookmark=True) - ] + ] v1.drivers = [link.Link.make_link('self', pecan.request.host_url, 'drivers', ''), link.Link.make_link('bookmark', pecan.request.host_url, 'drivers', '', bookmark=True) - ] + ] return v1 diff --git a/ironic/api/controllers/v1/chassis.py b/ironic/api/controllers/v1/chassis.py index b980678157..84d3800279 100644 --- a/ironic/api/controllers/v1/chassis.py +++ b/ironic/api/controllers/v1/chassis.py @@ -81,7 +81,7 @@ class Chassis(base.APIBase): 'chassis', chassis.uuid + "/nodes", bookmark=True) - ] + ] chassis.links = [link.Link.make_link('self', url, 'chassis', chassis.uuid), @@ -89,7 +89,7 @@ class Chassis(base.APIBase): url, 'chassis', chassis.uuid, bookmark=True) - ] + ] return chassis @classmethod diff --git a/ironic/api/controllers/v1/node.py b/ironic/api/controllers/v1/node.py index bdd7b8e23c..5080c5c8f6 100644 --- a/ironic/api/controllers/v1/node.py +++ b/ironic/api/controllers/v1/node.py @@ -593,7 +593,7 @@ class Node(base.APIBase): link.Link.make_link('bookmark', url, 'nodes', node.uuid + "/ports", bookmark=True) - ] + ] # NOTE(lucasagomes): The numeric ID should not be exposed to # the user, it's internal only. @@ -606,7 +606,7 @@ class Node(base.APIBase): node.uuid), link.Link.make_link('bookmark', url, 'nodes', node.uuid, bookmark=True) - ] + ] return node @classmethod diff --git a/ironic/api/controllers/v1/port.py b/ironic/api/controllers/v1/port.py index af4ba5ba98..314bac8cdf 100644 --- a/ironic/api/controllers/v1/port.py +++ b/ironic/api/controllers/v1/port.py @@ -119,7 +119,7 @@ class Port(base.APIBase): link.Link.make_link('bookmark', url, 'ports', port.uuid, bookmark=True) - ] + ] return port @classmethod diff --git a/ironic/conductor/manager.py b/ironic/conductor/manager.py index b6f5fdd6f0..7d70b41afa 100644 --- a/ironic/conductor/manager.py +++ b/ironic/conductor/manager.py @@ -145,7 +145,7 @@ conductor_opts = [ help='List of comma separated metric types which need to be' ' sent to Ceilometer. The default value, "ALL", is a ' 'special value meaning send all the sensor data.' - ), + ), cfg.IntOpt('sync_local_state_interval', default=180, help='When conductors join or leave the cluster, existing ' diff --git a/ironic/db/sqlalchemy/alembic/versions/3cb628139ea4_nodes_add_console_enabled.py b/ironic/db/sqlalchemy/alembic/versions/3cb628139ea4_nodes_add_console_enabled.py index 0cb1d92636..7fe1ca4758 100644 --- a/ironic/db/sqlalchemy/alembic/versions/3cb628139ea4_nodes_add_console_enabled.py +++ b/ironic/db/sqlalchemy/alembic/versions/3cb628139ea4_nodes_add_console_enabled.py @@ -29,7 +29,7 @@ import sqlalchemy as sa def upgrade(): op.add_column('nodes', sa.Column('console_enabled', sa.Boolean) - ) + ) def downgrade(): diff --git a/ironic/drivers/modules/ilo/management.py b/ironic/drivers/modules/ilo/management.py index 7870fadb63..6bf47e5e66 100644 --- a/ironic/drivers/modules/ilo/management.py +++ b/ironic/drivers/modules/ilo/management.py @@ -33,7 +33,7 @@ ilo_client = importutils.try_import('proliantutils.ilo.ribcl') BOOT_DEVICE_MAPPING_TO_ILO = {boot_devices.PXE: 'NETWORK', boot_devices.DISK: 'HDD', boot_devices.CDROM: 'CDROM' - } + } BOOT_DEVICE_ILO_TO_GENERIC = {v: k for k, v in BOOT_DEVICE_MAPPING_TO_ILO.items()} diff --git a/ironic/drivers/modules/iscsi_deploy.py b/ironic/drivers/modules/iscsi_deploy.py index b6c10ec478..be1472a510 100644 --- a/ironic/drivers/modules/iscsi_deploy.py +++ b/ironic/drivers/modules/iscsi_deploy.py @@ -230,7 +230,7 @@ def get_deploy_info(node, **kwargs): 'ephemeral_mb': 1024 * int(i_info['ephemeral_gb']), 'preserve_ephemeral': i_info['preserve_ephemeral'], 'node_uuid': node.uuid, - } + } missing = [key for key in params if params[key] is None] if missing: diff --git a/ironic/tests/api/utils.py b/ironic/tests/api/utils.py index 2bba3f6dc4..ee029717fb 100644 --- a/ironic/tests/api/utils.py +++ b/ironic/tests/api/utils.py @@ -40,7 +40,7 @@ class FakeMemcache(object): 'tenantId': '123i2910', 'tenantName': 'mytenant', 'roles': [{'name': 'admin'}] - }, + }, } }, 'tokens/%s' % MEMBER_TOKEN: { @@ -52,7 +52,7 @@ class FakeMemcache(object): 'tenantId': 'project-good', 'tenantName': 'goodies', 'roles': [{'name': 'Member'}] - } + } } } } diff --git a/ironic/tests/conductor/test_manager.py b/ironic/tests/conductor/test_manager.py index 53086943cf..3ee631677a 100644 --- a/ironic/tests/conductor/test_manager.py +++ b/ironic/tests/conductor/test_manager.py @@ -1819,7 +1819,8 @@ class UpdatePortTestCase(_ServiceSetUpMixin, tests_db_base.DbTestCase): @mock.patch.object(dbapi.IMPL, 'get_nodeinfo_list') @mock.patch.object(task_manager, 'acquire') def test___send_sensor_data_disabled(self, acquire_mock, - get_nodeinfo_list_mock, _mapped_to_this_conductor_mock): + get_nodeinfo_list_mock, + _mapped_to_this_conductor_mock): node = obj_utils.create_test_node(self.context, driver='fake') self._start_service() diff --git a/ironic/tests/objects/test_objects.py b/ironic/tests/objects/test_objects.py index cb9f72a786..3f6f44ed7e 100644 --- a/ironic/tests/objects/test_objects.py +++ b/ironic/tests/objects/test_objects.py @@ -427,7 +427,7 @@ class _TestObject(object): 'ironic_object.data': {'created_at': timeutils.isotime(dt), 'updated_at': timeutils.isotime(dt), - } + } } actual = obj.obj_to_primitive() # ironic_object.changes is built from a set and order is undefined diff --git a/tox.ini b/tox.ini index 259eecab2d..966b05497b 100644 --- a/tox.ini +++ b/tox.ini @@ -52,7 +52,7 @@ commands = {posargs} [flake8] # E711: ignored because it is normal to use "column == None" in sqlalchemy -ignore = E123,E124,E125,E126,E127,E128,E129,E711 +ignore = E123,E126,E127,E128,E129,E711 exclude = .venv,.git,.tox,dist,doc,*openstack/common*,*lib/python*,*egg,build,tools,*ironic/nova* max-complexity=17