From: Kefu Chai Date: Wed, 12 Sep 2018 08:43:54 +0000 (+0800) Subject: worker: create archive_dir before putting log file in it X-Git-Tag: 1.1.0~314^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=db22aa7bc3fc8a4cd0078c239bc25f1b57f0e4b3;p=teuthology.git worker: create archive_dir before putting log file in it before d488b9bd, the memo for rerunning a suite is noted down by the last-in-suite job. when the last-in-suite job is performed, the archive_dir has been created by the jobs which performs tests, see the `Creating archive dir` line in run_job() in teuthology/worker.py . but after d488b9bd, the memo is logged by the first-in-suite job, by then, none of the test jobs is performed, so their archive dirs are not created. i think that's why the first-in-suite job fails to write the memo to $archive_dir/results.log. Signed-off-by: Kefu Chai --- diff --git a/teuthology/worker.py b/teuthology/worker.py index 401f9d393..8e061c66f 100644 --- a/teuthology/worker.py +++ b/teuthology/worker.py @@ -193,12 +193,12 @@ def run_job(job_config, teuth_bin_path, archive_dir, verbose): if job_config.get('first_in_suite') or job_config.get('last_in_suite'): if teuth_config.results_server: report.try_delete_jobs(job_config['name'], job_config['job_id']) + suite_archive_dir = os.path.join(archive_dir, safe_archive) + safepath.makedirs('/', suite_archive_dir) args = [ os.path.join(teuth_bin_path, 'teuthology-results'), - '--archive-dir', - os.path.join(archive_dir, safe_archive), - '--name', - job_config['name'], + '--archive-dir', suite_archive_dir, + '--name', job_config['name'], ] if job_config.get('first_in_suite'): log.info('Generating memo for %s', job_config['name'])