From 079123bb0b29fba19fa1b12d545493cbbd2d7024 Mon Sep 17 00:00:00 2001 From: Richard Theis Date: Thu, 3 Dec 2015 11:20:07 -0600 Subject: Remote security group name not displayed for rule The 'security group rule list' command was updated to display the remote security group name for a security group rule. This was done via a new 'Remote Security Group' column. The output of the 'security group rule create' and 'security group show' commands was also updated to include 'remote_security_group' information instead of the raw 'group' information returned from the API layer. Change-Id: I5f9600338c8331966d2c658109a24b502c538106 Closes-Bug: #1520003 --- openstackclient/compute/v2/security_group.py | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'openstackclient/compute') diff --git a/openstackclient/compute/v2/security_group.py b/openstackclient/compute/v2/security_group.py index 8844f5cc..a514085b 100644 --- a/openstackclient/compute/v2/security_group.py +++ b/openstackclient/compute/v2/security_group.py @@ -54,6 +54,11 @@ def _xform_security_group_rule(sgroup): info['ip_protocol'] = '' elif info['ip_protocol'].lower() == 'icmp': info['port_range'] = '' + group = info.pop('group') + if 'name' in group: + info['remote_security_group'] = group['name'] + else: + info['remote_security_group'] = '' return info @@ -299,6 +304,7 @@ class ListSecurityGroupRule(lister.Lister): "IP Protocol", "IP Range", "Port Range", + "Remote Security Group", ) return (column_headers, (utils.get_item_properties( -- cgit v1.2.1