[Kimchi-devel] [PATCHv3 3/3] Clear pep8 failure in make check

lvroyce at linux.vnet.ibm.com lvroyce at linux.vnet.ibm.com
Thu Feb 27 08:25:21 UTC 2014


From: Royce Lv <lvroyce at linux.vnet.ibm.com>

isoinfo.py, storageservers.py and test_model.py fail in make check
because of pep8, fix it.

Signed-off-by: Royce Lv <lvroyce at linux.vnet.ibm.com>
---
 src/kimchi/isoinfo.py              | 4 ++--
 src/kimchi/model/storageservers.py | 4 ++--
 tests/test_model.py                | 6 +++---
 3 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/src/kimchi/isoinfo.py b/src/kimchi/isoinfo.py
index 1e9e02d..8d423ad 100644
--- a/src/kimchi/isoinfo.py
+++ b/src/kimchi/isoinfo.py
@@ -183,7 +183,7 @@ class IsoImage(object):
         for i in xrange(1, 4):
             fmt = IsoImage.EL_TORITO_BOOT_RECORD
             ptr = i * IsoImage.SECTOR_SIZE
-            tmp_data = data[ptr:ptr+fmt.size]
+            tmp_data = data[ptr:ptr + fmt.size]
             if len(tmp_data) < fmt.size:
                 return
 
@@ -212,7 +212,7 @@ class IsoImage(object):
                                  {'filename': self.path})
 
         fmt = IsoImage.EL_TORITO_BOOT_ENTRY
-        tmp_data = data[ptr:ptr+fmt.size]
+        tmp_data = data[ptr:ptr + fmt.size]
         (boot, media_type, load_seg, sys_type,
          pad0, sectors, load_rba) = self._unpack(fmt, tmp_data)
         if boot == 0x88:
diff --git a/src/kimchi/model/storageservers.py b/src/kimchi/model/storageservers.py
index d4fba9d..167fedd 100644
--- a/src/kimchi/model/storageservers.py
+++ b/src/kimchi/model/storageservers.py
@@ -64,8 +64,8 @@ class StorageServerModel(object):
         for pool in pools:
             try:
                 pool_info = self.pool.lookup(pool)
-                if pool_info['source'] and \
-                   pool_info['source']['addr'] == server:
+                if (pool_info['source'] and
+                        pool_info['source']['addr'] == server):
                     return dict(host=server)
             except NotFoundError:
                 # Avoid inconsistent pool result because of lease between list
diff --git a/tests/test_model.py b/tests/test_model.py
index 2b34619..298b0a2 100644
--- a/tests/test_model.py
+++ b/tests/test_model.py
@@ -956,7 +956,7 @@ class ModelTests(unittest.TestCase):
         for repo in test_repos:
             inst.repositories_create(repo)
         host_repos = inst.repositories_get_list()
-        self.assertEquals(system_host_repos+len(test_repos), len(host_repos))
+        self.assertEquals(system_host_repos + len(test_repos), len(host_repos))
 
         for repo in test_repos:
             repo_info = inst.repository_lookup(repo.get('repo_id'))
@@ -994,7 +994,7 @@ class ModelTests(unittest.TestCase):
         inst.repositories_create(repo)
 
         host_repos = inst.repositories_get_list()
-        self.assertEquals(system_host_repos+1, len(host_repos))
+        self.assertEquals(system_host_repos + 1, len(host_repos))
 
         new_repo = {'repo_id': 'fedora-fake',
                     'repo_name': 'Fedora 19 Update FAKE',
@@ -1024,7 +1024,7 @@ class ModelTests(unittest.TestCase):
         inst.repositories_create(repo)
 
         host_repos = inst.repositories_get_list()
-        self.assertEquals(system_host_repos+1, len(host_repos))
+        self.assertEquals(system_host_repos + 1, len(host_repos))
 
         repo_info = inst.repository_lookup(repo.get('repo_id'))
         self.assertEquals(True, repo_info.get('enabled'))
-- 
1.8.1.2




More information about the Kimchi-devel mailing list