diff mbox

[Branch,~linaro-validation/lava-dispatcher/trunk] Rev 304: Fix from Le Chi Thu to log a message when submit_results fails

Message ID 20120529021312.19870.7920.launchpad@ackee.canonical.com
State Accepted
Headers show

Commit Message

Michael-Doyle Hudson May 29, 2012, 2:13 a.m. UTC
Merge authors:
  Le Chi Thu le.chi.thu@linaro.org <le.chi.thu@linaro.org>
Related merge proposals:
  https://code.launchpad.net/~le-chi-thu/lava-dispatcher/rapport-result-submit-failures/+merge/104353
  proposed by: Le Chi Thu (le-chi-thu)
  review: Approve - Michael Hudson-Doyle (mwhudson)
------------------------------------------------------------
revno: 304 [merge]
committer: Michael Hudson-Doyle <michael.hudson@linaro.org>
branch nick: trunk
timestamp: Tue 2012-05-29 14:10:58 +1200
message:
  Fix from Le Chi Thu to log a message when submit_results fails
modified:
  lava_dispatcher/job.py


--
lp:lava-dispatcher
https://code.launchpad.net/~linaro-validation/lava-dispatcher/trunk

You are subscribed to branch lp:lava-dispatcher.
To unsubscribe from this branch go to https://code.launchpad.net/~linaro-validation/lava-dispatcher/trunk/+edit-subscription
diff mbox

Patch

=== modified file 'lava_dispatcher/job.py'
--- lava_dispatcher/job.py	2012-05-08 22:03:24 +0000
+++ lava_dispatcher/job.py	2012-05-29 02:10:58 +0000
@@ -85,7 +85,7 @@ 
             'items': {'type': 'string'},
             'optional': True,
             },
-        }, 
+        },
     }
 
 
@@ -143,7 +143,7 @@ 
         if 'device_type' in self.job_data:
             metadata['target.device_type'] = self.job_data['device_type']
         self.context.test_data.add_metadata(metadata)
-        
+
         self.context.test_data.add_tags(self.tags)
 
         try:
@@ -190,7 +190,12 @@ 
                 params = submit_results.get('parameters', {})
                 action = lava_commands[submit_results['command']](
                     self.context)
-                action.run(**params)
+                try:
+                    logging.info("Submitting the test result with parameters = %s", params)
+                    action.run(**params)
+                except Exception as err:
+                    logging.error("Failed to submit the test result. Error = %s", err)
+                    raise
 
     def _set_logging_level(self):
         # set logging level is optional