if 'qpid' in line:
continue # TODO: explain why this is here
if comment and comment in line:
- line = line[:line.rfind(comment)]
+ line = line[:line.find(comment)]
line = line.strip()
if line and line not in tokens:
tokens.append(line)
line = line.strip()
if line.startswith('IMAGE_URLS'):
if '#' in line:
- line = line[:line.rfind('#')]
+ line = line[:line.find('#')]
if line.endswith(';;'):
line = line[:-2]
line = line.split('=', 1)[1].strip()
# 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__':
# https://bugs.launchpad.net/ubuntu/+source/python2.7/+bug/839588
sudo -H virtualenv /usr/zuul-swift-logs-env
sudo -H /usr/zuul-swift-logs-env/bin/pip install python-magic argparse \
- requests glob2
+ requests glob2 requestsexceptions
# Create a virtualenv for os-testr (which contains subunit2html)
# this is in /usr instead of /usr/loca/ due to this bug on precise:
shell.parse_args([])
shell.CONF.set_override('connection', DB_URI, group='database')
session = api.get_session()
- run_ids = api.get_recent_successful_runs(num_runs=10,
- session=session)
+ runs = api.get_recent_successful_runs_by_run_metadata(
+ 'build_name', 'gate-tempest-dsvm-neutron-full',
+ num_runs=10, session=session)
session.close()
preseed_path = os.path.join(TEMPEST_PATH, 'preseed-streams')
- os.mkdir(preseed_path)
- for run in run_ids:
- with open(os.path.join(preseed_path, run + '.subunit'), 'w') as fd:
- write_subunit.sql2subunit(run, fd)
+ if not os.path.isdir(preseed_path):
+ os.mkdir(preseed_path)
+ for run in runs:
+ with open(os.path.join(preseed_path, run.uuid + '.subunit'), 'w') as fd:
+ write_subunit.sql2subunit(run.uuid, fd)
if __name__ == '__main__':
main()