From f353253122ca39aeb092656cea011a06e70103a4 Mon Sep 17 00:00:00 2001 From: "jiahui.qiang" Date: Tue, 17 Jan 2017 02:42:53 +0800 Subject: Error in the return of command 'volume qos create' This patch fixed a 'volume qos create' display mistake in argument of 'specs'[1]. For command such as: $ openstack volume qos create hello [1]https://bugs.launchpad.net/python-openstackclient/+bug/1656767 Closes-bug:#1656767 Change-Id: Ia9fce833d318d9b52b97c12cfb89e2d3c5465fbe --- openstackclient/volume/v2/qos_specs.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'openstackclient/volume') diff --git a/openstackclient/volume/v2/qos_specs.py b/openstackclient/volume/v2/qos_specs.py index b7f49eca..8e1d67b5 100644 --- a/openstackclient/volume/v2/qos_specs.py +++ b/openstackclient/volume/v2/qos_specs.py @@ -95,6 +95,9 @@ class CreateQos(command.ShowOne): qos_spec = volume_client.qos_specs.create(parsed_args.name, specs) + qos_spec._info.update( + {'properties': utils.format_dict(qos_spec._info.pop('specs'))} + ) return zip(*sorted(six.iteritems(qos_spec._info))) @@ -190,8 +193,11 @@ class ListQos(command.Lister): for association in qos_associations] qos._info.update({'associations': associations}) + display_columns = ( + 'ID', 'Name', 'Consumer', 'Associations', 'Properties') + columns = ('ID', 'Name', 'Consumer', 'Associations', 'Specs') - return (columns, + return (display_columns, (utils.get_dict_properties( s._info, columns, formatters={ @@ -254,7 +260,8 @@ class ShowQos(command.ShowOne): qos_spec._info.update({ 'associations': utils.format_list(associations) }) - qos_spec._info.update({'specs': utils.format_dict(qos_spec.specs)}) + qos_spec._info.update( + {'properties': utils.format_dict(qos_spec._info.pop('specs'))}) return zip(*sorted(six.iteritems(qos_spec._info))) -- cgit v1.2.1