]> git-server-git.apps.pok.os.sepia.ceph.com Git - teuthology.git/commitdiff
Don't fail if there's no job_id
authorZack Cerza <zack@cerza.org>
Wed, 11 Sep 2013 18:56:48 +0000 (13:56 -0500)
committerZack Cerza <zack@cerza.org>
Wed, 11 Sep 2013 18:58:19 +0000 (13:58 -0500)
teuthology/run.py
teuthology/run_tasks.py

index 08e34ace7af74502ec98a6c8eafb59996e555ac3..68e40e33aeea089a38ce61b304bd38f3c927d8b3 100644 (file)
@@ -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)
 
index a791e907687b85daa51d04294a23a0fbaaae9ab3..ca77393adf514d620870fa72ca89f004c0afde03 100644 (file)
@@ -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,