Don't cache inactive repos

We have attic and stackforge projects all of which are now inactive.
Because they are inactive we don't need to be caching these repos on
every test slave image.

Change-Id: I4df78c3d542758ce6159c195c1407f1d56f565a0
This commit is contained in:
Clark Boylan 2016-03-05 18:01:08 -08:00
parent 6f7da56c9f
commit 69a073edbe
2 changed files with 19 additions and 11 deletions

View File

@ -32,12 +32,16 @@ def main():
projects = [f['project'] for f in yaml.load(urllib2.urlopen(URL))]
with open(PROJECTS_REPOS, 'w') as projects_list:
for project in projects:
args = dict(
name=os.path.basename(project),
location=os.path.join('/opt/git', project),
url='%s/%s.git' % (GIT_BASE, project))
# Skip repos that are inactive
dirname = os.path.dirname(project)
if not ('attic' in dirname or dirname == 'stackforge'):
args = dict(
name=os.path.basename(project),
location=os.path.join('/opt/git', project),
url='%s/%s.git' % (GIT_BASE, project))
projects_list.write("%(name)s git %(location)s %(url)s\n" % args)
projects_list.write("%(name)s git %(location)s "
"%(url)s\n" % args)
# Clone openstack-infra/system-config again so that we can use it to
# build the image without interferring with the slave repo cache.
project = 'openstack-infra/system-config'

View File

@ -74,14 +74,18 @@ def main():
# YAML module which is not in the stdlib.
m = PROJECT_RE.match(line)
if m:
(status, out) = clone_repo(m.group(1))
print out
if status != 0:
print 'Retrying to clone %s' % m.group(1)
(status, out) = clone_repo(m.group(1))
project = m.group(1)
dirname = os.path.dirname(project)
# Skip repos that are inactive
if not ('attic' in dirname or dirname == 'stackforge'):
(status, out) = clone_repo(project)
print out
if status != 0:
raise Exception('Failed to clone %s' % m.group(1))
print 'Retrying to clone %s' % m.group(1)
(status, out) = clone_repo(m.group(1))
print out
if status != 0:
raise Exception('Failed to clone %s' % m.group(1))
if __name__ == '__main__':