From 9dace0d3f9d5cb15d5e39cbab55d48315e1dec39 Mon Sep 17 00:00:00 2001 From: Zhiteng Huang Date: Fri, 27 Jun 2014 18:44:41 +0800 Subject: [PATCH] Enable hacking rule E111,E112,E113 This change fixes all violations of E111, E112, E113 hacking rules and enable these rules in tox.ini Change-Id: I79b1f2f26fbbec4ad47230ca2e8a2802458a6cee --- bin/cinder-manage | 6 +++--- cinder/tests/test_gpfs.py | 4 ++-- cinder/tests/test_migrations.py | 2 +- cinder/volume/drivers/hds/iscsi.py | 4 ++-- tox.ini | 2 +- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/bin/cinder-manage b/bin/cinder-manage index c9eec4ad99f..830b09c9e55 100755 --- a/bin/cinder-manage +++ b/bin/cinder-manage @@ -484,9 +484,9 @@ category_opt = cfg.SubCommandOpt('category', def get_arg_string(args): arg = None if args[0] == '-': - # (Note)zhiteng: args starts with FLAGS.oparser.prefix_chars - # is optional args. Notice that cfg module takes care of - # actual ArgParser so prefix_chars is always '-'. + # (Note)zhiteng: args starts with FLAGS.oparser.prefix_chars + # is optional args. Notice that cfg module takes care of + # actual ArgParser so prefix_chars is always '-'. if args[1] == '-': # This is long optional arg arg = args[2:] diff --git a/cinder/tests/test_gpfs.py b/cinder/tests/test_gpfs.py index 8637be815e1..bc71600f2e6 100644 --- a/cinder/tests/test_gpfs.py +++ b/cinder/tests/test_gpfs.py @@ -558,7 +558,7 @@ class GPFSDriverTestCase(test.TestCase): gpfs_images_share_mode=org_value_share_mode) CONF.gpfs_images_dir = org_value_dir - # fail directory.startswith('/') + # fail directory.startswith('/') org_value_mount = self.driver.configuration.gpfs_mount_point_base self.flags(volume_driver=self.driver_name, gpfs_mount_point_base='_' + self.volumes_path) @@ -573,7 +573,7 @@ class GPFSDriverTestCase(test.TestCase): gpfs_mount_point_base=org_value_mount) CONF.gpfs_images_dir = org_value_dir - # fail os.path.isdir(directory) + # fail os.path.isdir(directory) org_value_mount = self.driver.configuration.gpfs_mount_point_base self.flags(volume_driver=self.driver_name, gpfs_mount_point_base=self.volumes_path + '_') diff --git a/cinder/tests/test_migrations.py b/cinder/tests/test_migrations.py index d3ec208f324..156fdc36260 100644 --- a/cinder/tests/test_migrations.py +++ b/cinder/tests/test_migrations.py @@ -859,7 +859,7 @@ class TestMigrations(test.TestCase): def test_migration_017(self): """Test that added encryption information works correctly.""" - # upgrade schema + # upgrade schema for (key, engine) in self.engines.items(): migration_api.version_control(engine, TestMigrations.REPOSITORY, diff --git a/cinder/volume/drivers/hds/iscsi.py b/cinder/volume/drivers/hds/iscsi.py index 2908c842408..827b18f1c18 100644 --- a/cinder/volume/drivers/hds/iscsi.py +++ b/cinder/volume/drivers/hds/iscsi.py @@ -169,7 +169,7 @@ class HDSISCSIDriver(driver.ISCSIDriver): # dict based on iSCSI portal ip addresses conf = {} for line in lines: - # only record up links + # only record up links if 'CTL' in line and 'Up' in line: inf = line.split() (ctl, port, ip, ipp) = (inf[1], inf[3], inf[5], inf[7]) @@ -510,7 +510,7 @@ class HDSISCSIDriver(driver.ISCSIDriver): (arid, lun) = info['id_lu'] if 'tgt' in info.keys(): # connected? LOG.info("delete lun loc %s" % info['tgt']) - # loc = id.lun + # loc = id.lun (_portal, iqn, loc, ctl, port, hlun) = info['tgt'] self.bend.del_iscsi_conn(self.config['hnas_cmd'], self.config['mgmt_ip0'], diff --git a/tox.ini b/tox.ini index 44931e3a3d3..ae8c95fd6c3 100644 --- a/tox.ini +++ b/tox.ini @@ -50,7 +50,7 @@ commands = {posargs} # Due to hacking 0.9.2 following checking are ignored on purpose for now # E111,E112,E113,E121,E122,E123,E126,E128,E251,E265 # E713,F403,F841,H302,H305,H307,H402,H405,H803,H904 -ignore = E111,E112,E113,E121,E122,E123,E126,E128,E251,E265,E711,E712,E713,F402,F841,H104,H302,H305,H307,H402,H405,H803,H904 +ignore = E121,E122,E123,E126,E128,E251,E265,E711,E712,E713,F402,F841,H104,H302,H305,H307,H402,H405,H803,H904 builtins = _ exclude = .git,.venv,.tox,dist,tools,doc,common,*egg,build