From: Lingchaox Xin Date: Fri, 14 Jun 2013 03:05:45 +0000 (+0800) Subject: Pylint for common/git.py X-Git-Tag: 0.14~135 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=9b1ceb3c769a2c15c4999b7954f58be4b072aec9;p=services%2Fjenkins-scripts.git Pylint for common/git.py Change-Id: Ibcafeff673d52193c8a9e66ead89904211a49005 --- diff --git a/common/git.py b/common/git.py index e73e8b2..21aae06 100644 --- a/common/git.py +++ b/common/git.py @@ -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.'