From c2630ae91a0e4bae662926a0e45d71c79683b584 Mon Sep 17 00:00:00 2001 From: Akihiro Motoki Date: Mon, 15 May 2017 04:01:07 +0000 Subject: [PATCH] Use cliff formattable columns in object storage commands Partial-Bug: #1687955 Partially implement blueprint osc-formattable-columns Change-Id: I65737561c9b5ef29f5878316d2ff89f3d538158f --- openstackclient/object/v1/account.py | 5 +++-- openstackclient/object/v1/container.py | 3 ++- openstackclient/object/v1/object.py | 3 ++- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/openstackclient/object/v1/account.py b/openstackclient/object/v1/account.py index 4847f8bbc2..95be8132c9 100644 --- a/openstackclient/object/v1/account.py +++ b/openstackclient/object/v1/account.py @@ -13,9 +13,9 @@ """Account v1 action implementations""" +from osc_lib.cli import format_columns from osc_lib.cli import parseractions from osc_lib.command import command -from osc_lib import utils import six from openstackclient.i18n import _ @@ -48,7 +48,8 @@ class ShowAccount(command.ShowOne): def take_action(self, parsed_args): data = self.app.client_manager.object_store.account_show() if 'properties' in data: - data['properties'] = utils.format_dict(data.pop('properties')) + data['properties'] = format_columns.DictColumn( + data.pop('properties')) return zip(*sorted(six.iteritems(data))) diff --git a/openstackclient/object/v1/container.py b/openstackclient/object/v1/container.py index 9f689ab6b0..02e8d27780 100644 --- a/openstackclient/object/v1/container.py +++ b/openstackclient/object/v1/container.py @@ -17,6 +17,7 @@ import logging +from osc_lib.cli import format_columns from osc_lib.cli import parseractions from osc_lib.command import command from osc_lib import utils @@ -230,7 +231,7 @@ class ShowContainer(command.ShowOne): container=parsed_args.container, ) if 'properties' in data: - data['properties'] = utils.format_dict(data.pop('properties')) + data['properties'] = format_columns.DictColumn(data['properties']) return zip(*sorted(six.iteritems(data))) diff --git a/openstackclient/object/v1/object.py b/openstackclient/object/v1/object.py index aeb0253653..3747e19e47 100644 --- a/openstackclient/object/v1/object.py +++ b/openstackclient/object/v1/object.py @@ -17,6 +17,7 @@ import logging +from osc_lib.cli import format_columns from osc_lib.cli import parseractions from osc_lib.command import command from osc_lib import exceptions @@ -284,7 +285,7 @@ class ShowObject(command.ShowOne): object=parsed_args.object, ) if 'properties' in data: - data['properties'] = utils.format_dict(data.pop('properties')) + data['properties'] = format_columns.DictColumn(data['properties']) return zip(*sorted(six.iteritems(data)))