diff options
author | Richard Maw <richard.maw@codethink.co.uk> | 2015-09-24 14:51:01 +0000 |
---|---|---|
committer | Richard Maw <richard.maw@codethink.co.uk> | 2015-09-24 14:51:01 +0000 |
commit | 61db5840a078a5cff3683ce9df0407c2a2d81068 (patch) | |
tree | d02a9756c1863c7ad0defa9000c32e4b864bfedb /firehose_call.py | |
parent | 5684f15acb6cb4bbac4cd3760af6924dc231e5b5 (diff) | |
download | buildslave-scripts-61db5840a078a5cff3683ce9df0407c2a2d81068.tar.gz |
Allow firehose config split into directories
Diffstat (limited to 'firehose_call.py')
-rw-r--r-- | firehose_call.py | 25 |
1 files changed, 10 insertions, 15 deletions
diff --git a/firehose_call.py b/firehose_call.py index 8e7b75c..2fb43c3 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_mappings import mapping +from firehose_config import get_landings log_file = open(LOGFILE,'a') @@ -35,17 +35,12 @@ if __name__ == '__main__': print "firehose_map.py requires a repo argument" exit(1) - 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) + 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) |