diff mbox

[Branch,~linaro-validation/lava-dispatcher/trunk] Rev 514: Add --target parameter to `lava dispatch`

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

Commit Message

Antonio Terceiro Jan. 2, 2013, 4:30 p.m. UTC
Merge authors:
  Antonio Terceiro (terceiro)
Related merge proposals:
  https://code.launchpad.net/~terceiro/lava-dispatcher/target-cmdline/+merge/140949
  proposed by: Antonio Terceiro (terceiro)
  review: Approve - Andy Doan (doanac)
------------------------------------------------------------
revno: 514 [merge]
committer: Antonio Terceiro <antonio.terceiro@linaro.org>
branch nick: trunk
timestamp: Wed 2013-01-02 13:28:52 -0300
message:
  Add --target parameter to `lava dispatch`
modified:
  lava/dispatcher/commands.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/commands.py'
--- lava/dispatcher/commands.py	2012-11-30 19:14:23 +0000
+++ lava/dispatcher/commands.py	2012-12-20 16:59:51 +0000
@@ -1,3 +1,4 @@ 
+import json
 import logging
 import os
 import sys
@@ -62,6 +63,11 @@ 
             "job_file",
             metavar="JOB",
             help="Test scenario file")
+        parser.add_argument(
+            "--target",
+            default = None,
+            help="Run the job on a specific target device"
+        )
 
     def invoke(self):
         if self.args.oob_fd:
@@ -96,6 +102,10 @@ 
         # Load the scenario file
         with open(self.args.job_file) as stream:
             jobdata = stream.read()
+        if self.args.target is not None:
+            json_jobdata = json.loads(jobdata)
+            json_jobdata['target'] = self.args.target
+            jobdata = json.dumps(json_jobdata)
         job = LavaTestJob(jobdata, oob_file, config)
 
         #FIXME Return status