From b1c541581fc3a8465ddd79e381db8cec15717743 Mon Sep 17 00:00:00 2001 From: Shu Yingya Date: Thu, 21 Sep 2017 11:23:31 +0800 Subject: [PATCH] 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 --- saharaclient/osc/v1/clusters.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/saharaclient/osc/v1/clusters.py b/saharaclient/osc/v1/clusters.py index 72355a2b..b197c1d7 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)