diff options
author | Trevor McKay <tmckay@redhat.com> | 2014-01-14 13:27:49 -0500 |
---|---|---|
committer | Trevor McKay <tmckay@redhat.com> | 2014-01-14 13:33:02 -0500 |
commit | 8b705687019f4c438500057ac2627ab532f084c2 (patch) | |
tree | 570119aa9c3a9505082563bd71b0a3c3b25cc8e4 | |
parent | 6f0b512a4a0ae3020d441c83da6c69db67872203 (diff) | |
download | python-saharaclient-0.4.1.tar.gz |
JobExecutionsManager.create() should handle input_id/output_id == None0.4.1
Input and output ids are not part of the Java workflow JSON schema. Including
them, even set to None, causes an error. In order to maintain backward
compatibility, leave input_id and output_id as required parameters but
do not add them to the job exec data if they are None.
Closes-Bug: #1268695
Change-Id: I8df8cb86094f5d67ca16de7d6dd253af142eca25
-rw-r--r-- | savannaclient/api/job_executions.py | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/savannaclient/api/job_executions.py b/savannaclient/api/job_executions.py index b1a7065..8fdf43a 100644 --- a/savannaclient/api/job_executions.py +++ b/savannaclient/api/job_executions.py @@ -37,10 +37,18 @@ class JobExecutionsManager(base.ResourceManager): job_exec_data={}): url = "/jobs/%s/execute" % job_id data = copy.copy(job_exec_data) + + # Leave these out if they are null. For Java job types they + # are not part of the schema + io_ids = (("input_id", input_id), + ("output_id", output_id)) + for key, value in io_ids: + if value is not None: + data.update({key: value}) + + # These are always required data.update( { - "input_id": input_id, - "output_id": output_id, "cluster_id": cluster_id, "job_configs": configs }) |