[Kimchi-devel] [PATCHv2 3/3] Clear pep8 failure in make check
Royce Lv
lvroyce at linux.vnet.ibm.com
Tue Feb 25 07:49:36 UTC 2014
pep8 1.3.3 can checkout these error, but pep8 1.4.6 cannot.
Refer to pep8 doc, these are errors. so fix them.
On 2014年02月25日 15:07, lvroyce at linux.vnet.ibm.com wrote:
> 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 5629391..4d4578f 100644
> --- a/src/kimchi/isoinfo.py
> +++ b/src/kimchi/isoinfo.py
> @@ -186,7 +186,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
>
> @@ -215,7 +215,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 26e1f6f..26d53f3 100644
> --- a/src/kimchi/model/storageservers.py
> +++ b/src/kimchi/model/storageservers.py
> @@ -67,8 +67,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 b0039a3..10c6d57 100644
> --- a/tests/test_model.py
> +++ b/tests/test_model.py
> @@ -921,7 +921,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'))
> @@ -959,7 +959,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',
> @@ -989,7 +989,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'))
More information about the Kimchi-devel
mailing list