diff --git a/scripts/yaml_filter.py b/scripts/yaml_filter.py index 80d6f291..307c3a34 100755 --- a/scripts/yaml_filter.py +++ b/scripts/yaml_filter.py @@ -11,9 +11,10 @@ repos_keep = yaml.safe_load(open(sys.argv[1]))['keep'].split() target = {'repositories': {}} + + if repos_info: + for key in repos_info["repositories"]: + if key in repos_keep: + target['repositories'][key] = repos_info["repositories"][key] - for key in repos_info["repositories"]: - if key in repos_keep: - target['repositories'][key] = repos_info["repositories"][key] - - print(yaml.dump(target)) \ No newline at end of file + print(yaml.dump(target))