From: Anthony PERARD Date: Wed, 2 Nov 2016 12:24:21 +0000 (+0000) Subject: nodepool/scripts: Synchronize with upstream X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=1b92a5208e5a7dc6d8223ddd3569b6b428568bfa;p=openstack%2Fci-loop-config.git nodepool/scripts: Synchronize with upstream --- diff --git a/nodepool/scripts/cache_devstack.py b/nodepool/scripts/cache_devstack.py index 379d13a..0c75059 100755 --- a/nodepool/scripts/cache_devstack.py +++ b/nodepool/scripts/cache_devstack.py @@ -46,7 +46,7 @@ def tokenize(fn, tokens, distribution, comment=None): 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) @@ -59,7 +59,7 @@ def _legacy_find_images(basedir): 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() diff --git a/nodepool/scripts/cache_git_repos.py b/nodepool/scripts/cache_git_repos.py index bea36c9..46b5758 100755 --- a/nodepool/scripts/cache_git_repos.py +++ b/nodepool/scripts/cache_git_repos.py @@ -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__': diff --git a/nodepool/scripts/prepare_node.sh b/nodepool/scripts/prepare_node.sh index c039dcc..92718c9 100755 --- a/nodepool/scripts/prepare_node.sh +++ b/nodepool/scripts/prepare_node.sh @@ -232,7 +232,7 @@ sudo rm -fr /tmp/zuul # 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: diff --git a/nodepool/scripts/prepare_tempest_testrepository.py b/nodepool/scripts/prepare_tempest_testrepository.py index 2947baf..a933b85 100755 --- a/nodepool/scripts/prepare_tempest_testrepository.py +++ b/nodepool/scripts/prepare_tempest_testrepository.py @@ -37,14 +37,16 @@ def main(): 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()