Fix and enable pep8 E502, E712
pep8 E502 and E712 were temporarily disabld when upgrading to pep8 1.2 Change-Id: If5158304cb8e73ef844dea9f726df6f8fe305269
This commit is contained in:
@@ -1146,7 +1146,7 @@ def fixed_ip_disassociate_all_by_timeout(context, host, time):
|
||||
join((models.Network,
|
||||
models.Network.id == models.FixedIp.network_id)).\
|
||||
join((models.Instance,
|
||||
models.Instance.uuid == \
|
||||
models.Instance.uuid ==
|
||||
models.FixedIp.instance_uuid)).\
|
||||
filter(host_filter).\
|
||||
all()
|
||||
@@ -4380,7 +4380,7 @@ def _instance_type_extra_specs_get_query(context, flavor_id,
|
||||
subquery()
|
||||
return model_query(context, models.InstanceTypeExtraSpecs,
|
||||
session=session, read_deleted="no").\
|
||||
filter(models.InstanceTypeExtraSpecs.\
|
||||
filter(models.InstanceTypeExtraSpecs.
|
||||
instance_type_id.in_(t))
|
||||
|
||||
|
||||
|
||||
@@ -82,7 +82,7 @@ def upgrade(migrate_engine):
|
||||
|
||||
if migrate_engine.name == "mysql":
|
||||
migrate_engine.execute("ALTER TABLE volume_id_mappings Engine=InnoDB")
|
||||
migrate_engine.execute("ALTER TABLE snapshot_id_mappings "\
|
||||
migrate_engine.execute("ALTER TABLE snapshot_id_mappings "
|
||||
"Engine=InnoDB")
|
||||
|
||||
volumes = Table('volumes', meta, autoload=True)
|
||||
|
||||
@@ -30,7 +30,7 @@ def upgrade(migrate_engine):
|
||||
meta.bind = migrate_engine
|
||||
instances = Table('instances', meta, autoload=True)
|
||||
|
||||
instance_list = list(instances.select().\
|
||||
instance_list = list(instances.select().
|
||||
where(instances.c.deleted == True).execute())
|
||||
for table_name in TABLES:
|
||||
table = Table(table_name, meta, autoload=True)
|
||||
@@ -55,7 +55,7 @@ def downgrade(migrate_engine):
|
||||
meta.bind = migrate_engine
|
||||
instances = Table('instances', meta, autoload=True)
|
||||
|
||||
instance_list = list(instances.select().\
|
||||
instance_list = list(instances.select().
|
||||
where(instances.c.deleted == True).execute())
|
||||
for table_name in TABLES:
|
||||
table = Table(table_name, meta, autoload=True)
|
||||
|
||||
@@ -222,7 +222,7 @@ class LinuxNetworkTestCase(test.TestCase):
|
||||
is_admin=True)
|
||||
|
||||
def get_vifs(_context, instance_uuid):
|
||||
return [vif for vif in vifs if vif['instance_uuid'] == \
|
||||
return [vif for vif in vifs if vif['instance_uuid'] ==
|
||||
instance_uuid]
|
||||
|
||||
def get_instance(_context, instance_id):
|
||||
|
||||
@@ -97,7 +97,7 @@ class IptablesManagerTestCase(test.TestCase):
|
||||
table.remove_rule('FORWARD', '-s 1.2.3.4/5 -j DROP')
|
||||
new_lines = self.manager._modify_rules(current_lines, table)
|
||||
self.assertTrue('[0:0] -A %s-FORWARD '
|
||||
'-s 1.2.3.4/5 -j DROP' % self.binary_name \
|
||||
'-s 1.2.3.4/5 -j DROP' % self.binary_name
|
||||
not in new_lines)
|
||||
|
||||
def test_nat_rules(self):
|
||||
|
||||
+1
-1
@@ -128,7 +128,7 @@ function run_pep8 {
|
||||
srcfiles+=" setup.py"
|
||||
|
||||
# Until all these issues get fixed, ignore.
|
||||
ignore='--ignore=N4,E12,E711,E712,E721,E502'
|
||||
ignore='--ignore=N4,E12,E711,E721'
|
||||
|
||||
${wrapper} python tools/hacking.py ${ignore} ${srcfiles}
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@ downloadcache = ~/cache/pip
|
||||
[testenv:pep8]
|
||||
deps=pep8==1.2
|
||||
commands =
|
||||
python tools/hacking.py --ignore=N4,E12,E711,E712,E721,E502 --repeat --show-source \
|
||||
python tools/hacking.py --ignore=N4,E12,E711,E721 --repeat --show-source \
|
||||
--exclude=.venv,.tox,dist,doc,*openstack/common*,*lib/python*,*egg .
|
||||
|
||||
[testenv:pylint]
|
||||
|
||||
Reference in New Issue
Block a user