summaryrefslogtreecommitdiff
path: root/openstackclient/network/v2/security_group.py
diff options
context:
space:
mode:
authorDean Troyer <dtroyer@gmail.com>2019-08-30 12:53:15 -0500
committerDean Troyer <dtroyer@gmail.com>2019-08-30 12:53:18 -0500
commit6ee7b8d138e07bfc37c5cd887f7afa49cdabb02f (patch)
treec8f5f45ff6bfc79242e6a92425a7c88583fcf2fc /openstackclient/network/v2/security_group.py
parenteed615e7d0fb0935ddde0565bf93174549f2456a (diff)
downloadpython-openstackclient-6ee7b8d138e07bfc37c5cd887f7afa49cdabb02f.tar.gz
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 <dtroyer@gmail.com>
Diffstat (limited to 'openstackclient/network/v2/security_group.py')
-rw-r--r--openstackclient/network/v2/security_group.py3
1 files changed, 3 insertions, 0 deletions
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,
}