summaryrefslogtreecommitdiff
path: root/saharaclient/osc/v1
diff options
context:
space:
mode:
Diffstat (limited to 'saharaclient/osc/v1')
-rw-r--r--saharaclient/osc/v1/cluster_templates.py8
-rw-r--r--saharaclient/osc/v1/clusters.py6
-rw-r--r--saharaclient/osc/v1/job_templates.py7
-rw-r--r--saharaclient/osc/v1/jobs.py9
-rw-r--r--saharaclient/osc/v1/node_group_templates.py8
5 files changed, 22 insertions, 16 deletions
diff --git a/saharaclient/osc/v1/cluster_templates.py b/saharaclient/osc/v1/cluster_templates.py
index aa053a6..440098f 100644
--- a/saharaclient/osc/v1/cluster_templates.py
+++ b/saharaclient/osc/v1/cluster_templates.py
@@ -473,8 +473,7 @@ class UpdateClusterTemplate(show.ShowOne):
'An error occurred when reading '
'shares from file %s: %s' % (parsed_args.shares, e))
- data = client.cluster_templates.update(
- ct_id,
+ update_dict = utils.create_dict_from_kwargs(
name=parsed_args.name,
plugin_name=plugin,
hadoop_version=version,
@@ -485,7 +484,10 @@ class UpdateClusterTemplate(show.ShowOne):
shares=shares,
is_public=parsed_args.is_public,
is_protected=parsed_args.is_protected
- ).to_dict()
+ )
+
+ data = client.cluster_templates.update(
+ ct_id, **update_dict).to_dict()
_format_ct_output(data)
data = utils.prepare_data(data, CT_FIELDS)
diff --git a/saharaclient/osc/v1/clusters.py b/saharaclient/osc/v1/clusters.py
index 1602e14..d61135b 100644
--- a/saharaclient/osc/v1/clusters.py
+++ b/saharaclient/osc/v1/clusters.py
@@ -455,14 +455,14 @@ class UpdateCluster(show.ShowOne):
'An error occurred when reading '
'shares from file %s: %s' % (parsed_args.shares, e))
- data = client.clusters.update(
- cluster_id,
+ update_dict = utils.create_dict_from_kwargs(
name=parsed_args.name,
description=parsed_args.description,
is_public=parsed_args.is_public,
is_protected=parsed_args.is_protected,
shares=shares
- ).cluster
+ )
+ data = client.clusters.update(cluster_id, **update_dict).cluster
_format_cluster_output(data)
data = utils.prepare_data(data, CLUSTER_FIELDS)
diff --git a/saharaclient/osc/v1/job_templates.py b/saharaclient/osc/v1/job_templates.py
index ce8d77e..952666f 100644
--- a/saharaclient/osc/v1/job_templates.py
+++ b/saharaclient/osc/v1/job_templates.py
@@ -314,13 +314,14 @@ class UpdateJobTemplate(show.ShowOne):
jt_id = utils.get_resource_id(
client.jobs, parsed_args.job_template)
- data = client.jobs.update(
- jt_id,
+ update_data = utils.create_dict_from_kwargs(
name=parsed_args.name,
description=parsed_args.description,
is_public=parsed_args.is_public,
is_protected=parsed_args.is_protected
- ).job
+ )
+
+ data = client.jobs.update(jt_id, **update_data).job
_format_job_template_output(data)
data = utils.prepare_data(data, JOB_TEMPLATE_FIELDS)
diff --git a/saharaclient/osc/v1/jobs.py b/saharaclient/osc/v1/jobs.py
index a232c1f..576c7ff 100644
--- a/saharaclient/osc/v1/jobs.py
+++ b/saharaclient/osc/v1/jobs.py
@@ -368,11 +368,12 @@ class UpdateJob(show.ShowOne):
self.log.debug("take_action(%s)" % parsed_args)
client = self.app.client_manager.data_processing
- data = client.job_executions.update(
- parsed_args.job,
+ update_dict = utils.create_dict_from_kwargs(
is_public=parsed_args.is_public,
- is_protected=parsed_args.is_protected
- ).job_execution
+ is_protected=parsed_args.is_protected)
+
+ data = client.job_executions.update(
+ parsed_args.job, **update_dict).job_execution
_format_job_output(data)
data = utils.prepare_data(data, JOB_FIELDS)
diff --git a/saharaclient/osc/v1/node_group_templates.py b/saharaclient/osc/v1/node_group_templates.py
index c86c76d..a24253d 100644
--- a/saharaclient/osc/v1/node_group_templates.py
+++ b/saharaclient/osc/v1/node_group_templates.py
@@ -660,8 +660,7 @@ class UpdateNodeGroupTemplate(show.ShowOne):
flavor_id = osc_utils.find_resource(
compute_client.flavors, parsed_args.flavor).id
- data = client.node_group_templates.update(
- ngt_id,
+ update_dict = utils.create_dict_from_kwargs(
name=parsed_args.name,
plugin_name=parsed_args.plugin,
hadoop_version=parsed_args.version,
@@ -683,7 +682,10 @@ class UpdateNodeGroupTemplate(show.ShowOne):
node_configs=configs,
shares=shares,
volumes_availability_zone=parsed_args.volumes_availability_zone
- ).to_dict()
+ )
+
+ data = client.node_group_templates.update(
+ ngt_id, **update_dict).to_dict()
_format_ngt_output(data)
data = utils.prepare_data(data, NGT_FIELDS)