Merge "Don't cache inactive repos"

This commit is contained in:
Jenkins 2016-03-07 01:12:25 +00:00 committed by Gerrit Code Review
commit 3a6dd094cc
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__':