diff options
Diffstat (limited to 'cgi-bin')
-rwxr-xr-x | cgi-bin/monkey-index.cgi | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/cgi-bin/monkey-index.cgi b/cgi-bin/monkey-index.cgi index da8d61d..9feecd9 100755 --- a/cgi-bin/monkey-index.cgi +++ b/cgi-bin/monkey-index.cgi @@ -27,7 +27,7 @@ def main(): params = cgi.FieldStorage() - division = 'index' + division = 'default' group_filter = None if 'division' in params and re.match('^[A-Za-z0-9-]+$', params['division'].value): @@ -39,18 +39,23 @@ def main(): print('Content-Type: text/plain') print('') + if not os.path.isdir(testroot + '/' + division): + print('# Division ' + division + ' not found') + return + + flist = [f for f in os.listdir(testroot) if f.endswith('.yaml')] + flist.extend(f for f in os.listdir(testroot + '/' + division) if f.endswith('.yaml')) + # load all test plan yaml files - for fname in os.listdir(testroot): - if not fname.endswith(".yaml"): - continue + for fname in flist: with open(os.path.join(testroot, fname), "r") as file_handle: files[fname] = yaml.load(file_handle, Loader=yaml.CSafeLoader) - if division + '.yaml' not in files: - print('# Unknown division ' + division) + if 'index.yaml' not in files: + print('# Division has no index') return - for group in files[division + '.yaml']: + for group in files['index.yaml']: if group_filter is not None and group_filter != group['group']: continue print("---") |