Fix incorrect indentations found by Pep 1.4.6+

Pep 1.4.5 had several bugs with checking indentation of
hanging and nested sets. Fix fallout.

Change-Id: Ibcb1679e0bd283feb3c1568ba214bc525575fd43
This commit is contained in:
Dirk Mueller 2013-10-19 10:50:16 +02:00
parent 85858ce798
commit 2e1ce123a1
39 changed files with 145 additions and 151 deletions

View File

@ -263,8 +263,7 @@ class ExtensionMiddleware(wsgi.Middleware):
def __init__(self, application,
ext_mgr=None):
self.ext_mgr = (ext_mgr
or ExtensionManager(
get_extensions_path()))
or ExtensionManager(get_extensions_path()))
mapper = routes.Mapper()
# extended resources

View File

@ -55,7 +55,8 @@ def upgrade(active_plugins=None, options=None):
sa.Column('network_id', sa.String(length=36),
primary_key=True),
sa.Column('binding_type',
sa.Enum('flat', 'vlan', 'stt', 'gre', 'l3_ext',
sa.Enum(
'flat', 'vlan', 'stt', 'gre', 'l3_ext',
name=(
'nvp_network_bindings_binding_type')),
nullable=False, primary_key=True),
@ -80,18 +81,15 @@ def downgrade(active_plugins=None, options=None):
"(SELECT network_id from nvp_multi_provider_networks)")
# create table with previous contains
op.create_table('rename_nvp_network_bindings',
sa.Column('network_id', sa.String(length=36),
primary_key=True),
op.create_table(
'rename_nvp_network_bindings',
sa.Column('network_id', sa.String(length=36), primary_key=True),
sa.Column('binding_type',
sa.Enum('flat', 'vlan', 'stt', 'gre', 'l3_ext',
name=(
'nvp_network_bindings_binding_type')),
name=('nvp_network_bindings_binding_type')),
nullable=False),
sa.Column('phy_uuid', sa.String(36),
nullable=True),
sa.Column('vlan_id', sa.Integer,
nullable=True, autoincrement=False))
sa.Column('phy_uuid', sa.String(36), nullable=True),
sa.Column('vlan_id', sa.Integer, nullable=True, autoincrement=False))
# copy data from nvp_network_bindings into rename_nvp_network_bindings
op.execute("INSERT INTO rename_nvp_network_bindings SELECT network_id, "

View File

@ -58,9 +58,7 @@ def upgrade(active_plugins=None, options=None):
)
op.add_column(
u'nsxrouterextattributess',
sa.Column('service_router',
sa.Boolean(),
nullable=False))
sa.Column('service_router', sa.Boolean(), nullable=False))
op.execute("UPDATE nsxrouterextattributess set service_router=False")

View File

@ -136,8 +136,7 @@ def reserve_specific_network(session, physical_network, segmentation_id):
entry = (session.query(mlnx_models_v2.SegmentationIdAllocation).
filter_by(physical_network=physical_network,
segmentation_id=segmentation_id).
with_lockmode('update').
one())
with_lockmode('update').one())
if entry.allocated:
raise q_exc.VlanIdInUse(vlan_id=segmentation_id,
physical_network=physical_network)

View File

@ -96,7 +96,8 @@ def main(argv):
if (default_gateways[svc_type] and
default_gateways[svc_type] not in gateway_services):
print("\t\t\tError: specified default %s gateway (%s) is "
"missing from NVP Gateway Services!" % (svc_type,
"missing from NVP Gateway Services!" % (
svc_type,
default_gateways[svc_type]))
errors += 1
transport_zones = get_transport_zones(cluster)

View File

@ -232,9 +232,7 @@ class EdgeLbDriver():
context.session, id, edge_id)
if not pool_binding:
msg = (_("pool_binding not found with id: %(id)s "
"edge_id: %(edge_id)s") % {
'id': id,
'edge_id': edge_id})
"edge_id: %(edge_id)s") % {'id': id, 'edge_id': edge_id})
LOG.error(msg)
raise vcns_exc.VcnsNotFound(
resource='router_service_binding', msg=msg)
@ -294,9 +292,7 @@ class EdgeLbDriver():
context.session, id, edge_id)
if not monitor_binding:
msg = (_("monitor_binding not found with id: %(id)s "
"edge_id: %(edge_id)s") % {
'id': id,
'edge_id': edge_id})
"edge_id: %(edge_id)s") % {'id': id, 'edge_id': edge_id})
LOG.error(msg)
raise vcns_exc.VcnsNotFound(
resource='router_service_binding', msg=msg)

View File

@ -670,10 +670,11 @@ class NetworkProfileTests(base.BaseTestCase,
_db_profile = (n1kv_db_v2.create_network_profile(
self.session, TEST_NETWORK_PROFILE_MULTI_SEGMENT))
self.assertIsNotNone(_db_profile)
db_profile = (self.session.query(n1kv_models_v2.NetworkProfile).
filter_by(
name=TEST_NETWORK_PROFILE_MULTI_SEGMENT['name']).
one())
db_profile = (
self.session.query(
n1kv_models_v2.NetworkProfile).filter_by(
name=TEST_NETWORK_PROFILE_MULTI_SEGMENT['name'])
.one())
self.assertIsNotNone(db_profile)
self.assertEqual(_db_profile.id, db_profile.id)
self.assertEqual(_db_profile.name, db_profile.name)

View File

@ -110,15 +110,15 @@ fake_network = dhcp.NetModel(True, dict(id='12345678-1234-5678-1234567890ab',
subnets=[fake_subnet1, fake_subnet2],
ports=[fake_port1]))
fake_meta_network = dhcp.NetModel(True,
dict(id='12345678-1234-5678-1234567890ab',
fake_meta_network = dhcp.NetModel(
True, dict(id='12345678-1234-5678-1234567890ab',
tenant_id='aaaaaaaa-aaaa-aaaa-aaaaaaaaaaaa',
admin_state_up=True,
subnets=[fake_meta_subnet],
ports=[fake_meta_port]))
fake_down_network = dhcp.NetModel(True,
dict(id='12345678-dddd-dddd-1234567890ab',
fake_down_network = dhcp.NetModel(
True, dict(id='12345678-dddd-dddd-1234567890ab',
tenant_id='aaaaaaaa-aaaa-aaaa-aaaaaaaaaaaa',
admin_state_up=False,
subnets=[],
@ -934,8 +934,8 @@ class TestNetworkCache(base.BaseTestCase):
fake_network)
def test_put_port(self):
fake_net = dhcp.NetModel(True,
dict(id='12345678-1234-5678-1234567890ab',
fake_net = dhcp.NetModel(
True, dict(id='12345678-1234-5678-1234567890ab',
tenant_id='aaaaaaaa-aaaa-aaaa-aaaaaaaaaaaa',
subnets=[fake_subnet1],
ports=[fake_port1]))
@ -946,8 +946,8 @@ class TestNetworkCache(base.BaseTestCase):
self.assertIn(fake_port2, fake_net.ports)
def test_put_port_existing(self):
fake_net = dhcp.NetModel(True,
dict(id='12345678-1234-5678-1234567890ab',
fake_net = dhcp.NetModel(
True, dict(id='12345678-1234-5678-1234567890ab',
tenant_id='aaaaaaaa-aaaa-aaaa-aaaaaaaaaaaa',
subnets=[fake_subnet1],
ports=[fake_port1, fake_port2]))
@ -959,8 +959,8 @@ class TestNetworkCache(base.BaseTestCase):
self.assertIn(fake_port2, fake_net.ports)
def test_remove_port_existing(self):
fake_net = dhcp.NetModel(True,
dict(id='12345678-1234-5678-1234567890ab',
fake_net = dhcp.NetModel(
True, dict(id='12345678-1234-5678-1234567890ab',
tenant_id='aaaaaaaa-aaaa-aaaa-aaaaaaaaaaaa',
subnets=[fake_subnet1],
ports=[fake_port1, fake_port2]))
@ -1146,11 +1146,12 @@ class TestDeviceManager(base.BaseTestCase):
self.assertFalse(plugin.update_dhcp_port.called)
def test_destroy(self):
fake_net = dhcp.NetModel(True,
dict(id='12345678-1234-5678-1234567890ab',
fake_net = dhcp.NetModel(
True, dict(id='12345678-1234-5678-1234567890ab',
tenant_id='aaaaaaaa-aaaa-aaaa-aaaaaaaaaaaa'))
fake_port = dhcp.DictModel(dict(id='12345678-1234-aaaa-1234567890ab',
fake_port = dhcp.DictModel(
dict(id='12345678-1234-aaaa-1234567890ab',
mac_address='aa:bb:cc:dd:ee:ff'))
with mock.patch('neutron.agent.linux.interface.NullDriver') as dvr_cls:
@ -1172,11 +1173,12 @@ class TestDeviceManager(base.BaseTestCase):
[mock.call.release_dhcp_port(fake_net.id, mock.ANY)])
def test_get_interface_name(self):
fake_net = dhcp.NetModel(True,
dict(id='12345678-1234-5678-1234567890ab',
fake_net = dhcp.NetModel(
True, dict(id='12345678-1234-5678-1234567890ab',
tenant_id='aaaaaaaa-aaaa-aaaa-aaaaaaaaaaaa'))
fake_port = dhcp.DictModel(dict(id='12345678-1234-aaaa-1234567890ab',
fake_port = dhcp.DictModel(
dict(id='12345678-1234-aaaa-1234567890ab',
mac_address='aa:bb:cc:dd:ee:ff'))
with mock.patch('neutron.agent.linux.interface.NullDriver') as dvr_cls:
@ -1197,8 +1199,8 @@ class TestDeviceManager(base.BaseTestCase):
self.assertEqual(len(plugin.mock_calls), 0)
def test_get_device_id(self):
fake_net = dhcp.NetModel(True,
dict(id='12345678-1234-5678-1234567890ab',
fake_net = dhcp.NetModel(
True, dict(id='12345678-1234-5678-1234567890ab',
tenant_id='aaaaaaaa-aaaa-aaaa-aaaaaaaaaaaa'))
expected = ('dhcp1ae5f96c-c527-5079-82ea-371a01645457-12345678-1234-'
'5678-1234567890ab')