[Kimchi-devel] [PATCH] Fix PEP8 in scan.py

Rodrigo Trujillo rodrigo.trujillo at linux.vnet.ibm.com
Thu Apr 24 19:22:26 UTC 2014


Fixes pep9 issues in src/kimchi/scan.py and adds it to PEP8_WHITELIST.

Signed-off-by: Rodrigo Trujillo <rodrigo.trujillo at linux.vnet.ibm.com>
---
 Makefile.am        |  1 +
 src/kimchi/scan.py | 15 +++++++++------
 2 files changed, 10 insertions(+), 6 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index 1e4a8be..9785de9 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -60,6 +60,7 @@ PEP8_WHITELIST = \
 	src/kimchi/repositories.py \
 	src/kimchi/rollbackcontext.py \
 	src/kimchi/root.py \
+	src/kimchi/scan.py \
 	src/kimchi/server.py \
 	src/kimchi/swupdate.py \
 	src/kimchi/template.py \
diff --git a/src/kimchi/scan.py b/src/kimchi/scan.py
index b67e3a5..e50dbbc 100644
--- a/src/kimchi/scan.py
+++ b/src/kimchi/scan.py
@@ -15,7 +15,7 @@
 #
 # You should have received a copy of the GNU Lesser General Public
 # License along with this library; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301 USA
 #
 
 import glob
@@ -32,6 +32,7 @@ from kimchi.utils import kimchi_log
 
 SCAN_IGNORE = ['/tmp/kimchi-scan-*']
 
+
 class Scanner(object):
     SCAN_TTL = 300
 
@@ -56,8 +57,8 @@ class Scanner(object):
                     shutil.rmtree(d)
                     self.clean_cb(transient_pool)
         except OSError as e:
-            kimchi_log.debug(
-                    "Exception %s occured when cleaning stale pool, ignore" % e.message)
+            msg = "Exception %s occured when cleaning stale pool, ignore"
+            kimchi_log.debug(msg % e.message)
 
     def scan_dir_prepare(self, name):
         # clean stale scan storage pools
@@ -71,16 +72,18 @@ class Scanner(object):
             duplicates = "%s/%s*" % (params['pool_path'], iso_name)
             for f in glob.glob(duplicates):
                 iso_img = IsoImage(f)
-                if (iso_info['distro'], iso_info['version']) == iso_img.probe():
+                if (iso_info['distro'], iso_info['version']) == \
+                   iso_img.probe():
                     return
 
-            iso_path = iso_name + hashlib.md5(iso_info['path']).hexdigest() + '.iso'
+            iso_path = iso_name + hashlib.md5(iso_info['path']).hexdigest() + \
+                '.iso'
             link_name = os.path.join(params['pool_path'],
                                      os.path.basename(iso_path))
             os.symlink(iso_info['path'], link_name)
 
         ignore_paths = params.get('ignore_list', [])
         scan_params = dict(path=params['scan_path'], updater=updater,
-            ignore_list=ignore_paths + SCAN_IGNORE)
+                           ignore_list=ignore_paths + SCAN_IGNORE)
         probe_iso(None, scan_params)
         cb('', True)
-- 
1.9.0




More information about the Kimchi-devel mailing list