diff options
author | Richard Maw <richard.maw@codethink.co.uk> | 2015-09-24 15:04:56 +0000 |
---|---|---|
committer | Richard Maw <richard.maw@codethink.co.uk> | 2015-09-24 15:04:56 +0000 |
commit | 37ab039dcefcb3c22a2d117ef26475d386b83223 (patch) | |
tree | 3f921e056c64914e52f2ddefb2b6ec9194d1c0ec /firehose_call.py | |
parent | c5298b34942685498f960ad95d12e429f1d52cd7 (diff) | |
download | buildslave-scripts-37ab039dcefcb3c22a2d117ef26475d386b83223.tar.gz |
Revert "Allow firehose config split into directories"
Will try again later
Diffstat (limited to 'firehose_call.py')
-rw-r--r-- | firehose_call.py | 25 |
1 files changed, 15 insertions, 10 deletions
diff --git a/firehose_call.py b/firehose_call.py index 2fb43c3..8e7b75c 100644 --- a/firehose_call.py +++ b/firehose_call.py @@ -4,7 +4,7 @@ import os FIREHOSE_DIR = 'src/firehose' LOGFILE = os.path.expanduser("~/orchestration/trigger_log") -from firehose_config import get_landings +from firehose_mappings import mapping log_file = open(LOGFILE,'a') @@ -35,12 +35,17 @@ if __name__ == '__main__': print "firehose_map.py requires a repo argument" exit(1) - landings = get_landings(FIREHOSE_DIR) - - for configs in landings: - exit_val = subprocess.call(firehose_cmd(configs), cwd=FIREHOSE_DIR) - if not exit_val: - log("Successfully configured %s" % ', '.join(configs)) - else: - log("Unsuccessful") - exit(exit_val) + try: + configs = mapping[repo] + except: + log("Unknown repo: %s, Firehose not triggered" % repo) + exit(0) + + os.chdir(FIREHOSE_DIR) + exit_val = subprocess.call(firehose_cmd(configs)) + if not exit_val: + log("Successful") + exit(exit_val) + else: + log("Unsuccessful") + exit(exit_val) |