diff options
author | lmr <lmr@592f7852-d20e-0410-864c-8624ca9c26a4> | 2010-12-07 00:05:40 +0000 |
---|---|---|
committer | lmr <lmr@592f7852-d20e-0410-864c-8624ca9c26a4> | 2010-12-07 00:05:40 +0000 |
commit | 78985fce8e92109cdeccd4a6075120bf2a6db334 (patch) | |
tree | 7cfd09aa3936909ffbc53e6c8d0ab8ea57316033 /cli | |
parent | 5e3ff3a6a42737a0123de018a20f62e9afd00014 (diff) |
cli/job.py: deal with parameterized_job parameter to job_create()
First appearing in commit d7249c87b56f922056917459c50df4102cb1ab68,
the 'parameterized_job' feature still is incomplete. By using a
parameterized job, one would be able to simply pass parameters to
create a job, but would lose the ability to specify a control file.
The API function 'get_info_for_clone' returns information about the
'parameterized_job' like this:
{"error": null, "result": {
...
"job" : {"parameterized_job": null, ... }
...
}
}
The job cloning functionality of 'atest', implemented in cli/job.py,
forwards this to the create_job() API function, which does NOT
accept it as a parameter. This fixes the atest cli error:
Operation create_job failed:
TypeError: create_job() got an unexpected keyword argument 'parameterized_job'
Signed-off-by: Cleber Rosa <crosa@redhat.com>
git-svn-id: svn://test.kernel.org/autotest/trunk@4978 592f7852-d20e-0410-864c-8624ca9c26a4
Diffstat (limited to 'cli')
-rw-r--r-- | cli/job.py | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -602,6 +602,12 @@ class job_clone(job_create_or_clone): for field in ('name', 'created_on', 'id', 'owner'): del clone_info['job'][field] + # Also remove parameterized_job field, as the feature still is + # incomplete, this tool does not attempt to support it for now, + # it uses a different API function and it breaks create_job() + if clone_info['job'].has_key('parameterized_job'): + del clone_info['job']['parameterized_job'] + # Keyword args cannot be unicode strings self.data.update((str(key), val) for key, val in clone_info['job'].iteritems()) |