From: Zack Cerza Date: Wed, 11 Sep 2013 18:56:48 +0000 (-0500) Subject: Don't fail if there's no job_id X-Git-Tag: 1.1.0~1883^2~6 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=4e9c5378ba164170dea610f169a9d0a0657dc494;p=teuthology.git Don't fail if there's no job_id --- diff --git a/teuthology/run.py b/teuthology/run.py index 08e34ace7..68e40e33a 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 a791e9076..ca77393ad 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,