diff options
| author | Richard Theis <rtheis@us.ibm.com> | 2015-12-03 11:20:07 -0600 |
|---|---|---|
| committer | Steve Martinelli <stevemar@ca.ibm.com> | 2015-12-14 14:48:19 -0500 |
| commit | 079123bb0b29fba19fa1b12d545493cbbd2d7024 (patch) | |
| tree | f5c9a77a2ce179f79773a979cd9eff2c392c056b /openstackclient/compute | |
| parent | 785caf503f9c275cb1cd106d57555c8ab0ac6b0f (diff) | |
| download | python-openstackclient-079123bb0b29fba19fa1b12d545493cbbd2d7024.tar.gz | |
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
Diffstat (limited to 'openstackclient/compute')
| -rw-r--r-- | openstackclient/compute/v2/security_group.py | 6 |
1 files changed, 6 insertions, 0 deletions
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( |
