Created
July 17, 2014 13:08
-
-
Save ttx/8ade722e387dcd6ce280 to your computer and use it in GitHub Desktop.
Script to identify repo mismatch between governance and Gerrit
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
# | |
# Script to identify repo mismatch between governance and Gerrit | |
# | |
# Copyright 2014 Thierry Carrez <thierry@openstack.org> | |
# All Rights Reserved. | |
# | |
# Licensed under the Apache License, Version 2.0 (the "License"); you may | |
# not use this file except in compliance with the License. You may obtain | |
# a copy of the License at | |
# | |
# http://www.apache.org/licenses/LICENSE-2.0 | |
# | |
# Unless required by applicable law or agreed to in writing, software | |
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT | |
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the | |
# License for the specific language governing permissions and limitations | |
# under the License. | |
import requests | |
import json | |
import yaml | |
# Known exceptions (owned by gerrit or the TC) | |
officialrepos = [ | |
'openstack-dev/sandbox', | |
'openstack/openstack', | |
'openstack/governance', | |
'openstack/openstack' | |
] | |
# Gather official repositories | |
r = requests.get('http://git.openstack.org/cgit/openstack/governance/plain/reference/programs.yaml') | |
programs = yaml.load(r.text) | |
for pname, program in programs.iteritems(): | |
for project in program['projects']: | |
officialrepos.append(project['repo']) | |
# Gather Gerrit repositories | |
p = requests.get('https://review.openstack.org/projects/?p=openstack') | |
for repo in sorted(json.loads(p.text[5:]).keys()): | |
# Ignore openstack-attic | |
if repo.startswith('openstack-attic'): | |
continue | |
if repo not in officialrepos: | |
print repo |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment