From 4e9c5378ba164170dea610f169a9d0a0657dc494 Mon Sep 17 00:00:00 2001 From: Zack Cerza Date: Wed, 11 Sep 2013 13:56:48 -0500 Subject: [PATCH] Don't fail if there's no job_id --- teuthology/run.py | 4 +++- teuthology/run_tasks.py | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/teuthology/run.py b/teuthology/run.py index 08e34ace7af74..68e40e33aeea0 100644 --- a/teuthology/run.py +++ b/teuthology/run.py @@ -139,8 +139,10 @@ def write_initial_metadata(ctx): 'description': ctx.description, 'owner': ctx.owner, 'pid': os.getpid(), - 'job_id': ctx.config['job_id'], } + if 'job_id' in ctx.config: + info['job_id'] = ctx.config['job_id'] + with file(os.path.join(ctx.archive, 'info.yaml'), 'w') as f: yaml.safe_dump(info, f, default_flow_style=False) diff --git a/teuthology/run_tasks.py b/teuthology/run_tasks.py index a791e907687b8..ca77393adf514 100644 --- a/teuthology/run_tasks.py +++ b/teuthology/run_tasks.py @@ -42,8 +42,9 @@ def run_tasks(tasks, ctx): 'task': taskname, 'owner': ctx.owner, } + job_id = getattr(ctx, 'job_id', None) extra = { - 'logs': get_http_log_path(ctx.archive, ctx.job_id), + 'logs': get_http_log_path(ctx.archive, job_id), } exc_id = sentry.captureException( tags=tags, -- 2.39.5