summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShu Yingya <yingya.shu@easystack.cn>2017-09-21 11:23:31 +0800
committerShu Yingya <yingya.shu@easystack.cn>2017-09-21 11:23:31 +0800
commitb1c541581fc3a8465ddd79e381db8cec15717743 (patch)
tree8a3ed022676de50bcac4caa85c7555bb24820e35
parentde595e2a3de0d3dc1e780ca912b048e7756b36af (diff)
downloadpython-saharaclient-b1c541581fc3a8465ddd79e381db8cec15717743.tar.gz
Fix KeyError in "cluster scale" command
When executing "openstack dataprocessing cluster scale" command, the method "_format_cluster_output" gets the argument which is wrapped. So the command will get the KeyError. Change-Id: I6883878ade46e2a8cec881a6a5df931922507ac6 Closes-Bug: #1718564
-rw-r--r--saharaclient/osc/v1/clusters.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/saharaclient/osc/v1/clusters.py b/saharaclient/osc/v1/clusters.py
index 72355a2..b197c1d 100644
--- a/saharaclient/osc/v1/clusters.py
+++ b/saharaclient/osc/v1/clusters.py
@@ -561,7 +561,7 @@ class ScaleCluster(command.ShowOne):
'An error occurred when reading '
'template from file %s: %s' % (parsed_args.json, e))
- data = client.clusters.scale(cluster.id, template).to_dict()
+ data = client.clusters.scale(cluster.id, template).cluster
else:
scale_object = {
"add_node_groups": [],
@@ -601,7 +601,7 @@ class ScaleCluster(command.ShowOne):
self.log.error(
'Error occurred during cluster scaling: %s' %
cluster.id)
- data = client.clusters.get(cluster.id).to_dict()
+ data = client.clusters.get(cluster.id).cluster
_format_cluster_output(data)
data = utils.prepare_data(data, CLUSTER_FIELDS)