Merge "Don't cache inactive repos"
This commit is contained in:
commit
3a6dd094cc
@ -32,12 +32,16 @@ def main():
|
|||||||
projects = [f['project'] for f in yaml.load(urllib2.urlopen(URL))]
|
projects = [f['project'] for f in yaml.load(urllib2.urlopen(URL))]
|
||||||
with open(PROJECTS_REPOS, 'w') as projects_list:
|
with open(PROJECTS_REPOS, 'w') as projects_list:
|
||||||
for project in projects:
|
for project in projects:
|
||||||
args = dict(
|
# Skip repos that are inactive
|
||||||
name=os.path.basename(project),
|
dirname = os.path.dirname(project)
|
||||||
location=os.path.join('/opt/git', project),
|
if not ('attic' in dirname or dirname == 'stackforge'):
|
||||||
url='%s/%s.git' % (GIT_BASE, project))
|
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
|
# Clone openstack-infra/system-config again so that we can use it to
|
||||||
# build the image without interferring with the slave repo cache.
|
# build the image without interferring with the slave repo cache.
|
||||||
project = 'openstack-infra/system-config'
|
project = 'openstack-infra/system-config'
|
||||||
|
@ -74,14 +74,18 @@ def main():
|
|||||||
# YAML module which is not in the stdlib.
|
# YAML module which is not in the stdlib.
|
||||||
m = PROJECT_RE.match(line)
|
m = PROJECT_RE.match(line)
|
||||||
if m:
|
if m:
|
||||||
(status, out) = clone_repo(m.group(1))
|
project = m.group(1)
|
||||||
print out
|
dirname = os.path.dirname(project)
|
||||||
if status != 0:
|
# Skip repos that are inactive
|
||||||
print 'Retrying to clone %s' % m.group(1)
|
if not ('attic' in dirname or dirname == 'stackforge'):
|
||||||
(status, out) = clone_repo(m.group(1))
|
(status, out) = clone_repo(project)
|
||||||
print out
|
print out
|
||||||
if status != 0:
|
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__':
|
if __name__ == '__main__':
|
||||||
|
Loading…
Reference in New Issue
Block a user