summaryrefslogtreecommitdiff
path: root/saharaclient
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2015-10-21 12:18:25 +0000
committerGerrit Code Review <review@openstack.org>2015-10-21 12:18:25 +0000
commite623e6d6ad67ba58a212d0baf0ca2b198e748c17 (patch)
tree73cfd97100b15e418817182061751581200a9edf /saharaclient
parent978bb44920039369ab0a2ace163b20ef2e299515 (diff)
parent1e986fa23c8e7443b51e1477b923f0fc656a0e7c (diff)
downloadpython-saharaclient-e623e6d6ad67ba58a212d0baf0ca2b198e748c17.tar.gz
Merge "Making parameters of job executions create optional"
Diffstat (limited to 'saharaclient')
-rw-r--r--saharaclient/api/job_executions.py21
-rw-r--r--saharaclient/tests/unit/test_job_executions.py1
2 files changed, 6 insertions, 16 deletions
diff --git a/saharaclient/api/job_executions.py b/saharaclient/api/job_executions.py
index 23fd686..4d76b24 100644
--- a/saharaclient/api/job_executions.py
+++ b/saharaclient/api/job_executions.py
@@ -33,29 +33,18 @@ class JobExecutionsManager(base.ResourceManager):
def delete(self, obj_id):
self._delete('/job-executions/%s' % obj_id)
- def create(self, job_id, cluster_id, input_id,
- output_id, configs, interface=None, is_public=None,
+ def create(self, job_id, cluster_id, input_id=None,
+ output_id=None, configs=None, interface=None, is_public=None,
is_protected=None):
url = "/jobs/%s/execute" % job_id
data = {
"cluster_id": cluster_id,
- "job_configs": configs,
}
- if interface:
- data['interface'] = interface
-
- # 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})
-
- self._copy_if_defined(data, is_public=is_public,
- is_protected=is_protected)
+ self._copy_if_defined(data, input_id=input_id, output_id=output_id,
+ job_configs=configs, interface=interface,
+ is_public=is_public, is_protected=is_protected)
return self._create(url, data, 'job_execution')
diff --git a/saharaclient/tests/unit/test_job_executions.py b/saharaclient/tests/unit/test_job_executions.py
index 855b149..e6867cb 100644
--- a/saharaclient/tests/unit/test_job_executions.py
+++ b/saharaclient/tests/unit/test_job_executions.py
@@ -29,6 +29,7 @@ class JobExecutionTest(base.BaseTestCase):
}
response = {
'cluster_id': 'cluster_id',
+ 'interface': {},
'job_configs': {}
}