From 08efeb7b9ec3f24558b8141c8854e1f01df948be Mon Sep 17 00:00:00 2001 From: Zack Cerza Date: Fri, 4 Oct 2013 12:35:03 -0500 Subject: [PATCH] Store the job_id as a str, not an int. Signed-off-by: Zack Cerza --- teuthology/queue.py | 2 +- teuthology/run.py | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/teuthology/queue.py b/teuthology/queue.py index 155f2a333b..4c5451c109 100644 --- a/teuthology/queue.py +++ b/teuthology/queue.py @@ -160,7 +160,7 @@ describe. One job is run at a time. log.debug('Config is: %s', job.body) job_config = yaml.safe_load(job.body) - job_config['job_id'] = job.jid + job_config['job_id'] = str(job.jid) safe_archive = safepath.munge(job_config['name']) archive_path_full = os.path.join(ctx.archive_dir, safe_archive, str(job.jid)) job_config['archive_path'] = archive_path_full diff --git a/teuthology/run.py b/teuthology/run.py index 6515954067..cdeee7b523 100644 --- a/teuthology/run.py +++ b/teuthology/run.py @@ -153,7 +153,6 @@ def main(): from .orchestra import monkey monkey.patch_all() - # WARNING: Do not import any modules that import logging before this next # block. That would cause connections to hang because the monkey patching # hadn't been done. @@ -169,6 +168,13 @@ def main(): from teuthology.misc import get_user ctx.owner = get_user() + # Older versions of teuthology stored job_id as an int. Convert it to a str + # if necessary. + job_id = ctx.config.get('job_id') + if job_id is not None: + job_id = str(job_id) + ctx.config['job_id'] = job_id + write_initial_metadata(ctx) report.try_push_job_info(ctx.config) -- 2.39.5