]> git-server-git.apps.pok.os.sepia.ceph.com Git - teuthology.git/commitdiff
Tweak logic of try_push_job_info() 124/head
authorZack Cerza <zack@cerza.org>
Fri, 4 Oct 2013 19:04:43 +0000 (14:04 -0500)
committerZack Cerza <zack@cerza.org>
Fri, 4 Oct 2013 20:01:16 +0000 (15:01 -0500)
Signed-off-by: Zack Cerza <zack.cerza@inktank.com>
teuthology/report.py
teuthology/run.py

index b896ff10c1810a55710bd00104e559ff6b8646a8..5e02a3a47306b83f048fc041b441c964a3381bf7 100755 (executable)
@@ -335,14 +335,14 @@ def push_job_info(run_name, job_id, job_info, base_uri=None):
     reporter.report_job(run_name, job_id, job_json)
 
 
-def try_push_job_info(job_config, job_info=None):
+def try_push_job_info(job_config, extra_info=None):
     """
     Wrap push_job_info, gracefully doing nothing if:
         A RequestFailedError is raised
         config.results_server is not set
 
-    :param job_config: The ctx.config object
-    :param job_info:   Dict to push (commonly None)
+    :param job_config: The ctx.config object to push
+    :param extra_info: Optional second dict to push
     """
     if not config.results_server:
         msg = "No results_server set in {yaml}; not attempting to push results"
@@ -350,10 +350,16 @@ def try_push_job_info(job_config, job_info=None):
     else:
         run_name = job_config['name']
         job_id = job_config['job_id']
-        if job_info is None:
+
+        if extra_info is not None:
+            job_info = extra_info.copy()
+            job_info.update(job_config)
+        else:
             job_info = job_config
 
         try:
+            log.info("Pushing job info to %s", config.results_server)
+            create_run(run_name)
             push_job_info(run_name, job_id, job_info)
         except RequestFailedError:
             log.exception("Could not report results to %s" %
index 20f58ad9e15688a89ab3786c19a85a48081596e9..767d4b6ccf05d7084a5cc62791b510ef90ee8ab2 100644 (file)
@@ -263,7 +263,6 @@ def main():
                 email_results(subject,"Teuthology",ctx.config['email-on-error'],emsg)
 
         report.try_push_job_info(ctx.config, ctx.summary)
-        report.try_push_job_info(ctx.config)
 
         if ctx.summary.get('success', True):
             log.info('pass')