From: Mathias Klette Date: Fri, 16 Sep 2011 18:09:44 +0000 (+0200) Subject: fix: pipe not usable that easy X-Git-Url: https://git.uhu-banane.net/?a=commitdiff_plain;h=d9bedc00bbe156a9725693506115bb601252c72f;p=profitbricks%2Fjenkins-build-scripts.git fix: pipe not usable that easy --- diff --git a/lib/git_helper.py b/lib/git_helper.py index 3690eca..769fd97 100644 --- a/lib/git_helper.py +++ b/lib/git_helper.py @@ -251,8 +251,7 @@ def git_get_treeish(refname): cmd = [ GIT, 'show', '--oneline', - '%s' % refname, - '|awk \'{print $1}\'' + '%s' % refname ] cmdobj = subprocess.Popen( cmd, @@ -283,10 +282,13 @@ def git_get_treeish(refname): ) return None else: - stdout_str = cmdobj.stdout.read() + stdout_str = cmdobj.stdout.read().split(" ") logger.debug( - 'found treeish "%s" for refspec "%s"' % (refname, stdout_str) + 'found treeish "%s" for refspec "%s", log: "%s"' % ( + refname, + stdout_str[0], + " ".join(stdout_str[1:]) ) - return stdout_str + return stdout_str[0] # vim: autoindent smartindent tabstop=4 expandtab shiftwidth=4 softtabstop=4 nu enc=utf-8 cinwords=if,elif,else,for,while,try,except,finally,def,class