Pylint for common/git.py
authorLingchaox Xin <lingchaox.xin@intel.com>
Fri, 14 Jun 2013 03:05:45 +0000 (11:05 +0800)
committerLingchaox Xin <lingchaox.xin@intel.com>
Fri, 14 Jun 2013 03:05:45 +0000 (11:05 +0800)
Change-Id: Ibcafeff673d52193c8a9e66ead89904211a49005

common/git.py

index e73e8b2..21aae06 100644 (file)
@@ -30,6 +30,10 @@ from common.utils import retry
 from gbp.git.repository import GitRepository
 import gbp.log as log
 
+class GitError(Exception):
+    """Local error handler"""
+    pass
+
 
 class Git(GitRepository):
     """The Git class wrappered from GitRepository"""
@@ -37,8 +41,8 @@ class Git(GitRepository):
         GitRepository.__init__(self, path)
         log.setup('auto', log.DEBUG)
 
-    def _git_getoutput(self, command, args=[], extra_env=None, cwd=None):
-        outs, ret = GitRepository._git_getoutput(self, command, args,
+    def _git_getoutput(self, command, args=(), extra_env=None, cwd=None):
+        outs, ret = GitRepository._git_getoutput(self, command, list(args),
                 extra_env, cwd)
         print '%s outputs: %s' % (command, outs)
         return outs, ret
@@ -176,10 +180,10 @@ def _clone_gitproject(giturl, gerritprj, localdir):
 
         if runner.show(gitcmd)[0] != 0:
             result = False
-    except Exception, ex:
+    except GitError, ger:
         result = False
         print '\nExcept occur when clone gerrit project'
-        print ex
+        print ger
 
     if not result:
         print '\nClone gerrit project Failed.'