diff mbox

[Branch,~linaro-validation/lava-dispatcher/trunk] Rev 122: copy device_type from job data to result metadata if present

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

Commit Message

Michael-Doyle Hudson Sept. 27, 2011, 4:08 a.m. UTC
Merge authors:
  Michael Hudson-Doyle (mwhudson)
Related merge proposals:
  https://code.launchpad.net/~mwhudson/lava-dispatcher/propagate-device_type/+merge/76938
  proposed by: Michael Hudson-Doyle (mwhudson)
  review: Approve - Yongqin Liu (liuyq0307)
------------------------------------------------------------
revno: 122 [merge]
committer: Michael Hudson-Doyle <michael.hudson@linaro.org>
branch nick: trunk
timestamp: Tue 2011-09-27 17:06:15 +1300
message:
  copy device_type from job data to result metadata if present
modified:
  lava_dispatcher/__init__.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/__init__.py'
--- lava_dispatcher/__init__.py	2011-09-23 04:41:15 +0000
+++ lava_dispatcher/__init__.py	2011-09-26 02:36:37 +0000
@@ -60,11 +60,18 @@ 
         else:
             submit_results = None
 
+        metadata = {
+            'target.hostname': self.target,
+        }
+
+        if 'device_type' in self.job_data:
+            metadata['target.device_type'] = self.job_data['device_type']
+        self.context.test_data.add_metadata(metadata)
+
         try:
             for cmd in self.job_data['actions']:
                 params = cmd.get('parameters', {})
                 metadata = cmd.get('metadata', {})
-                metadata['target.hostname'] = self.target
                 self.context.test_data.add_metadata(metadata)
                 action = lava_commands[cmd['command']](self.context)
                 try: