diff options
author | Kenny Woodson <kwoodson@redhat.com> | 2016-01-19 14:38:41 -0500 |
---|---|---|
committer | Kenny Woodson <kwoodson@redhat.com> | 2016-01-19 14:38:41 -0500 |
commit | a0826d4f5b86dce8be0e7b006014efaca4d66d26 (patch) | |
tree | 151f5b6d18ba6dab646181ca2879099c68886ac1 | |
parent | a1867d5eb999420884513e322d1fa333fce33633 (diff) | |
parent | 01ba7f730b9af8a81f88a5b12fb8a7031e624829 (diff) | |
download | openshift-a0826d4f5b86dce8be0e7b006014efaca4d66d26.tar.gz openshift-a0826d4f5b86dce8be0e7b006014efaca4d66d26.tar.bz2 openshift-a0826d4f5b86dce8be0e7b006014efaca4d66d26.tar.xz openshift-a0826d4f5b86dce8be0e7b006014efaca4d66d26.zip |
Merge pull request #1231 from kwoodson/remove_ruby
Fix for python yaml_validation and renmae.
-rwxr-xr-x | git/yaml_validation.py (renamed from git/yaml_validate.py) | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/git/yaml_validate.py b/git/yaml_validation.py index 7e0a08a4b..aa909b584 100755 --- a/git/yaml_validate.py +++ b/git/yaml_validation.py @@ -8,7 +8,6 @@ python yaml validator for a git commit import shutil import sys import os -import glob import tempfile import subprocess import yaml @@ -17,8 +16,8 @@ def get_changes(oldrev, newrev, tempdir): '''Get a list of git changes from oldrev to newrev''' proc = subprocess.Popen(['/usr/bin/git', 'diff', '--name-only', oldrev, newrev, '--diff-filter=ACM'], stdout=subprocess.PIPE) - proc.wait() - files = proc.stdout.read().strip().split('\n') + stdout, _ = proc.communicate() + files = stdout.split('\n') # No file changes if not files: @@ -26,9 +25,14 @@ def get_changes(oldrev, newrev, tempdir): cmd = '/usr/bin/git archive %s %s | /bin/tar x -C %s' % (newrev, " ".join(files), tempdir) proc = subprocess.Popen(cmd, shell=True) - proc.wait() + _, _ = proc.communicate() - return [fmod for fmod in glob.glob('%s/**/*' % tempdir) if not os.path.isdir(fmod)] + rfiles = [] + for dirpath, _, fnames in os.walk(tempdir): + for fname in fnames: + rfiles.append(os.path.join(dirpath, fname)) + + return rfiles def main(): ''' |