From e6f2e886a4246098eefae9d9a564b321b28280c2 Mon Sep 17 00:00:00 2001 From: Chris Behrens Date: Thu, 26 Jul 2012 09:15:09 +0000 Subject: Replace subprocess.check_output with Popen The check_output method does not exist in python 2.6 Fixes bug 1029014 Change-Id: I1ee24fa2029f21706924cc19dfcbc41655b022e6 --- tools/hacking.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'tools/hacking.py') diff --git a/tools/hacking.py b/tools/hacking.py index 3f876b747..ea490f748 100755 --- a/tools/hacking.py +++ b/tools/hacking.py @@ -386,7 +386,13 @@ def once_git_check_commit_title(): N801 """ #Get title of most recent commit - title = subprocess.check_output('git log --pretty=%s -1', shell=True) + + subp = subprocess.Popen(['git', 'log', '--pretty=%s', '-1'], + stdout=subprocess.PIPE) + title = subp.communicate()[0] + if subp.returncode: + raise Exception("git log failed with code %s" % subp.returncode) + #From https://github.com/openstack/openstack-ci-puppet # /blob/master/modules/gerrit/manifests/init.pp#L74 #Changeid|bug|blueprint -- cgit