summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Behrens <cbehrens@codestud.com>2012-07-26 09:15:09 +0000
committerChris Behrens <cbehrens@codestud.com>2012-07-26 09:15:09 +0000
commite6f2e886a4246098eefae9d9a564b321b28280c2 (patch)
treee1dc714dc1ec22d5cbc4a98d284721516061824d
parente238e07692c747ddcb0c70452578a812836cea67 (diff)
downloadnova-e6f2e886a4246098eefae9d9a564b321b28280c2.tar.gz
nova-e6f2e886a4246098eefae9d9a564b321b28280c2.tar.xz
nova-e6f2e886a4246098eefae9d9a564b321b28280c2.zip
Replace subprocess.check_output with Popen
The check_output method does not exist in python 2.6 Fixes bug 1029014 Change-Id: I1ee24fa2029f21706924cc19dfcbc41655b022e6
-rwxr-xr-xtools/hacking.py8
1 files changed, 7 insertions, 1 deletions
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