JobExecutionsManager.create() should handle input_id/output_id == None

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
This commit is contained in:
Trevor McKay
2014-01-14 13:27:49 -05:00
parent 6f0b512a4a
commit 8b70568701

View File

@@ -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
})