Pylint:fixed pylint findings and removed unused libs
authorZhang Qiang <qiang.z.zhang@intel.com>
Wed, 24 Apr 2013 13:46:41 +0000 (21:46 +0800)
committerZhang Qiang <qiang.z.zhang@intel.com>
Wed, 24 Apr 2013 13:47:12 +0000 (21:47 +0800)
Change-Id: Icb19383d82dbd4b0f993e95e90c0a3a471094423

gitbuildsys/cmd_build.py
gitbuildsys/ks_utils.py
gitbuildsys/utils.py

index 47cfa22..2330020 100644 (file)
@@ -23,7 +23,6 @@ import os
 import shutil
 import pwd
 import re
-import glob
 import urlparse
 
 from gitbuildsys.utils import Temp, RepoParser
@@ -77,7 +76,7 @@ QEMU_CAN_BUILD = ['armv4l', 'armv5el', 'armv5l', 'armv6l', 'armv7l',
 USERID = pwd.getpwuid(os.getuid())[0]
 TMPDIR = os.path.join(configmgr.get('tmpdir', 'general'), '%s-gbs' % USERID)
 
-def update_ks_files(args, repoparser, cachedir):
+def update_ks_files(args, repoparser):
     '''Update ks files: Add local repo and add user/pass if needed'''
     if args.arch:
         buildarch = args.arch
@@ -160,7 +159,7 @@ def prepare_repos_and_build_conf(args, arch, profile, cachedir):
                        'following repos:\n%s' % (arch, '\n'.join(repos)))
     cmd_opts += [('--repository=%s' % url.full) for url in repourls]
 
-    update_ks_files(args, repoparser, cachedir)
+    update_ks_files(args, repoparser)
     prepare_meta_files(args, repoparser)
 
     if args.dist:
index f1d847b..b0862bf 100644 (file)
@@ -18,7 +18,6 @@
 
 """Helpers, convenience utils, common APIs for ks file"""
 
-import os
 import urlparse
 
 from gitbuildsys.safe_url import SafeURL
@@ -67,7 +66,8 @@ class KSRepoUpdater(object):
                 repo_host = urlparse.urlsplit(repoargs[0].baseurl).hostname
                 if repo_host != host:
                     continue
-                repoargs[0].baseurl = SafeURL(repoargs[0].baseurl, user, passwd).full
+                repoargs[0].baseurl = SafeURL(repoargs[0].baseurl, user,
+                                              passwd).full
                 new_repo =  ' '.join(repoargs[1])
                 new_repo = '%s --baseurl=%s' % (new_repo, repoargs[0].baseurl)
                 kslist[index] = new_repo
index ec097ef..1513b1f 100644 (file)
@@ -372,7 +372,8 @@ class RepoParser(object):
 
     def _fetch_image_configs(self, latest_repo_url):
         """Fetch and parse image-config.xml."""
-        image_configs_url = latest_repo_url.pathjoin('builddata/image-configs.xml')
+        image_configs_url = latest_repo_url.pathjoin('builddata/'\
+                                                     'image-configs.xml')
         image_configs_xml = self.fetch(image_configs_url)
         if image_configs_xml:
             return self._parse_image_configs(image_configs_xml)
@@ -448,8 +449,8 @@ class RepoParser(object):
             self.group_file['name'] = self.fetch(group_url)
             if not self.group_file['name']:
                 continue
-            with open(self.group_file['name'], 'rb') as f:
-                md5sum = hexdigest(f)
+            with open(self.group_file['name'], 'rb') as fobj:
+                md5sum = hexdigest(fobj)
                 if 'md5sum' in self.group_file and \
                     md5sum != self.group_file['md5sum']:
                     log.warning('multiple differnent group files found')
@@ -460,8 +461,8 @@ class RepoParser(object):
             if not self.pattern_file['name']:
                 log.warning('pattern/group files do not exist in the same repo')
                 continue
-            with open(self.pattern_file['name'], 'rb') as f:
-                md5sum = hexdigest(f)
+            with open(self.pattern_file['name'], 'rb') as fobj:
+                md5sum = hexdigest(fobj)
                 if 'md5sum' in self.pattern_file and \
                    md5sum != self.pattern_file['md5sum']:
                     log.warning('multiple differnent pattern files found')