From 6ee7b8d138e07bfc37c5cd887f7afa49cdabb02f Mon Sep 17 00:00:00 2001 From: Dean Troyer Date: Fri, 30 Aug 2019 12:53:15 -0500 Subject: Format location columns in network commands These return a Munch from the SDK, which can be handled exactly like a dict so do that. Note that the location column has a nested project dict in the return value, this is addressed separately in osc_lib.format_columns in https://review.opendev.org/#/c/679474/. Change-Id: I99a6d192749a4ac76777f72be8118261c0521cb0 Signed-off-by: Dean Troyer --- openstackclient/network/v2/security_group.py | 3 +++ 1 file changed, 3 insertions(+) (limited to 'openstackclient/network/v2/security_group.py') diff --git a/openstackclient/network/v2/security_group.py b/openstackclient/network/v2/security_group.py index e3894738..38b4e97a 100644 --- a/openstackclient/network/v2/security_group.py +++ b/openstackclient/network/v2/security_group.py @@ -16,6 +16,7 @@ import argparse from cliff import columns as cliff_columns +from osc_lib.cli import format_columns from osc_lib.command import command from osc_lib import utils import six @@ -77,11 +78,13 @@ class ComputeSecurityGroupRulesColumn(cliff_columns.FormattableColumn): _formatters_network = { + 'location': format_columns.DictColumn, 'security_group_rules': NetworkSecurityGroupRulesColumn, } _formatters_compute = { + 'location': format_columns.DictColumn, 'rules': ComputeSecurityGroupRulesColumn, } -- cgit v1.2.1