Enable check for E123

E123 closing bracket does not match indentation of opening bracket's line

Change-Id: I3f941032efb5ca2ef9a78f865effbf79c8674ebb
This commit is contained in:
Andrey Kurilin 2014-09-24 22:30:16 +03:00
parent d05ae5dcc0
commit 8b8aa499e1
10 changed files with 31 additions and 43 deletions

View File

@ -562,7 +562,7 @@ class V3(Base):
'rescue': {'admin_password': 'RescuePassword'},
'get_console_output': {'output': 'foo'},
'rebuild': {'server': self.server_1234},
}
}
body_param_check_exists = {
'rebuild': 'image_ref',
'resize': 'flavor_ref'}

View File

@ -91,7 +91,7 @@ class ClientTest(utils.TestCase):
"passwordCredentials": {
"username": "user",
"password": "password"
}
}
}
}

View File

@ -22,7 +22,7 @@ from novaclient.v1_1.contrib import baremetal
extensions = [
extension.Extension(baremetal.__name__.split(".")[-1], baremetal),
]
]
cs = fakes.FakeClient(extensions=extensions)

View File

@ -1285,8 +1285,7 @@ class FakeHTTPClient(base_client.HTTPClient):
"tenant_id": "272bee4c1e624cd4a72a6b0ea55b4582",
"id": 2,
"rules": []}
]}
)
]})
def get_os_security_groups_1(self, **kw):
return (200, {}, {"security_group":
@ -1649,8 +1648,7 @@ class FakeHTTPClient(base_client.HTTPClient):
def get_os_hypervisors(self, **kw):
return (200, {}, {"hypervisors": [
{'id': 1234, 'hypervisor_hostname': 'hyper1'},
{'id': 5678, 'hypervisor_hostname': 'hyper2'},
]})
{'id': 5678, 'hypervisor_hostname': 'hyper2'}]})
def get_os_hypervisors_detail(self, **kw):
return (200, {}, {"hypervisors": [
@ -1688,7 +1686,7 @@ class FakeHTTPClient(base_client.HTTPClient):
'running_vms': 2,
'cpu_info': 'cpu_info',
'disk_available_least': 100}
]})
]})
def get_os_hypervisors_statistics(self, **kw):
return (200, {}, {"hypervisor_statistics": {
@ -1704,13 +1702,12 @@ class FakeHTTPClient(base_client.HTTPClient):
'current_workload': 4,
'running_vms': 4,
'disk_available_least': 200,
}})
}})
def get_os_hypervisors_hyper_search(self, **kw):
return (200, {}, {'hypervisors': [
{'id': 1234, 'hypervisor_hostname': 'hyper1'},
{'id': 5678, 'hypervisor_hostname': 'hyper2'}
]})
{'id': 5678, 'hypervisor_hostname': 'hyper2'}]})
def get_os_hypervisors_hyper_servers(self, **kw):
return (200, {}, {'hypervisors': [
@ -1718,15 +1715,13 @@ class FakeHTTPClient(base_client.HTTPClient):
'hypervisor_hostname': 'hyper1',
'servers': [
{'name': 'inst1', 'uuid': 'uuid1'},
{'name': 'inst2', 'uuid': 'uuid2'}
]},
{'name': 'inst2', 'uuid': 'uuid2'}]},
{'id': 5678,
'hypervisor_hostname': 'hyper2',
'servers': [
{'name': 'inst3', 'uuid': 'uuid3'},
{'name': 'inst4', 'uuid': 'uuid4'}
]}
]})
{'name': 'inst4', 'uuid': 'uuid4'}]}
]})
def get_os_hypervisors_hyper_no_servers_servers(self, **kw):
return (200, {}, {'hypervisors':
@ -2051,12 +2046,11 @@ class FakeHTTPClient(base_client.HTTPClient):
'rpc_host': '10.0.1.10',
'type': 'child',
'name': 'cell1',
'rpc_port': 5673
},
'rpc_port': 5673},
'type': 'child',
'rpc_port': 5673,
'loaded': True
}}
}}
return (200, {}, cell)
def get_os_cells_capacities(self, **kw):

View File

@ -30,8 +30,7 @@ class HypervisorsTest(utils.FixturedTestCase):
def test_hypervisor_index(self):
expected = [
dict(id=1234, hypervisor_hostname='hyper1'),
dict(id=5678, hypervisor_hostname='hyper2'),
]
dict(id=5678, hypervisor_hostname='hyper2')]
result = self.cs.hypervisors.list(False)
self.assert_called('GET', '/os-hypervisors')
@ -85,8 +84,7 @@ class HypervisorsTest(utils.FixturedTestCase):
def test_hypervisor_search(self):
expected = [
dict(id=1234, hypervisor_hostname='hyper1'),
dict(id=5678, hypervisor_hostname='hyper2'),
]
dict(id=5678, hypervisor_hostname='hyper2')]
result = self.cs.hypervisors.search('hyper')
self.assert_called('GET', '/os-hypervisors/hyper/search')
@ -106,7 +104,7 @@ class HypervisorsTest(utils.FixturedTestCase):
servers=[
dict(name='inst3', uuid='uuid3'),
dict(name='inst4', uuid='uuid4')]),
]
]
result = self.cs.hypervisors.search('hyper', True)
self.assert_called('GET', '/os-hypervisors/hyper/servers')
@ -164,7 +162,7 @@ class HypervisorsTest(utils.FixturedTestCase):
current_workload=4,
running_vms=4,
disk_available_least=200,
)
)
result = self.cs.hypervisors.statistics()
self.assert_called('GET', '/os-hypervisors/statistics')

View File

@ -640,11 +640,12 @@ class ServersTest(utils.FixturedTestCase):
'port_id': 'f35079da-36d5-4513-8ec1-0298d703f70e',
'mac_addr': 'fa:16:3e:4c:37:c8',
'port_state': 'ACTIVE',
'fixed_ips': [{
'subnet_id': 'f1ad93ad-2967-46ba-b403-e8cbbe65f7fa',
'ip_address': '10.2.0.96'
'fixed_ips': [
{
'subnet_id': 'f1ad93ad-2967-46ba-b403-e8cbbe65f7fa',
'ip_address': '10.2.0.96'
}]
}]
}]
# If server is not string representable, it will raise an exception,
# because attribute named 'name' cannot be found.
# Parameter 'loaded' must be True or it will try to get attribute

View File

@ -195,7 +195,7 @@ class FakeHTTPClient(fakes_v1_1.FakeHTTPClient):
'rescue': {'admin_password': 'RescuePassword'},
'get_console_output': {'output': 'foo'},
'rebuild': self.get_servers_1234()[2],
}
}
body_param_check_exists = {
'rebuild': 'image_ref',
'resize': 'flavor_ref',
@ -336,12 +336,10 @@ class FakeHTTPClient(fakes_v1_1.FakeHTTPClient):
def get_os_hypervisors_search(self, **kw):
if kw['query'] == 'hyper1':
return (200, {}, {'hypervisors': [
{'id': 1234, 'hypervisor_hostname': 'hyper1'},
]})
{'id': 1234, 'hypervisor_hostname': 'hyper1'}]})
return (200, {}, {'hypervisors': [
{'id': 1234, 'hypervisor_hostname': 'hyper1'},
{'id': 5678, 'hypervisor_hostname': 'hyper2'}
]})
{'id': 5678, 'hypervisor_hostname': 'hyper2'}]})
def get_os_hypervisors_1234_servers(self, **kw):
return (200, {}, {'hypervisor':
@ -349,9 +347,7 @@ class FakeHTTPClient(fakes_v1_1.FakeHTTPClient):
'hypervisor_hostname': 'hyper1',
'servers': [
{'name': 'inst1', 'id': 'uuid1'},
{'name': 'inst2', 'id': 'uuid2'}
]},
})
{'name': 'inst2', 'id': 'uuid2'}]}})
#
# Keypairs

View File

@ -26,8 +26,7 @@ class HypervisorsTest(test_hypervisors.HypervisorsTest):
def test_hypervisor_search(self):
expected = [
dict(id=1234, hypervisor_hostname='hyper1'),
dict(id=5678, hypervisor_hostname='hyper2'),
]
dict(id=5678, hypervisor_hostname='hyper2')]
result = self.cs.hypervisors.search('hyper')
self.assert_called('GET', '/os-hypervisors/search?query=hyper')

View File

@ -243,7 +243,7 @@ def _print_baremetal_nodes_list(nodes):
'PM Username',
'PM Password',
'Terminal Port',
], formatters=formatters)
], formatters=formatters)
def do_baremetal_node_list(cs, _args):
@ -270,7 +270,7 @@ def _print_baremetal_node_interfaces(interfaces):
'Datapath_ID',
'Port_No',
'Address',
])
])
@utils.arg('node',

View File

@ -41,9 +41,9 @@ downloadcache = ~/cache/pip
# H904 wrap long lines in parentheses instead of a backslash
# reason: removed in hacking (https://review.openstack.org/#/c/101701/)
#
# Additional checks are also ignored on purpose: E123, E124, E126,
# Additional checks are also ignored on purpose: E124, E126,
# E127, E128, E129, F811, F821
ignore = E123,E124,E126,E127,E128,E129,F811,F821,H402,H404,H405,H904
ignore = E124,E126,E127,E128,E129,F811,F821,H402,H404,H405,H904
show-source = True
exclude=.venv,.git,.tox,dist,*openstack/common*,*lib/python*,*egg,build,doc/source/conf.py