From 4c5c2c89ba63cc27f435447f000559b8634b8318 Mon Sep 17 00:00:00 2001 From: Will Holland Date: Mon, 28 Sep 2015 14:31:45 +0100 Subject: Fix sometimes passing HEAD as definitions sha This should not be done as it is logged in the list of built systems --- builder_logic.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/builder_logic.py b/builder_logic.py index 71c5c1d..9d422a9 100644 --- a/builder_logic.py +++ b/builder_logic.py @@ -114,12 +114,9 @@ def get_buildslave_scripts_sha(): def get_definitions_sha(ref): import os - owd = os.getcwd() - os.chdir(DEFINITIONS_DIR) _cmd = ['git', 'log', ref, '--format=format:%H', '-1'] - _proc = subprocess.Popen(_cmd, stdout=subprocess.PIPE) + _proc = subprocess.Popen(_cmd, stdout=subprocess.PIPE,cwd=DEFINITIONS_DIR) _out, _err = _proc.communicate() - os.chdir(owd) return _out.split()[0] def get_testing_sha(): @@ -140,11 +137,13 @@ if __name__ == '__main__': try: definitions_sha = sys.argv[2] except: - definitons_sha = get_definitions_sha(ref if ref != 'force' else 'HEAD') + definitons_sha = None try: system = sys.argv[3] except: system = DEFAULT_SYSTEM + if not definitions_sha or definitions_sha == 'HEAD': + definitions_sha = get_definitions_sha('ref') buildslave_scripts_sha = get_buildslave_scripts_sha() testing_sha = get_testing_sha() if ref=="force": -- cgit v1.2.1