diff options
| author | Zuul <zuul@review.opendev.org> | 2021-01-20 17:03:39 +0000 |
|---|---|---|
| committer | Gerrit Code Review <review@openstack.org> | 2021-01-20 17:03:39 +0000 |
| commit | bfa032cb1885d5129f7420432f42b68e6840548b (patch) | |
| tree | ae01be2e63623b7c3a414366491c07ce9b46ef4a /openstackclient/network | |
| parent | 6905e97565b5ddd147b1c277679d7a5eac616273 (diff) | |
| parent | e01e59caeb56cb7bf4f38403b82d0a265b163098 (diff) | |
| download | python-openstackclient-bfa032cb1885d5129f7420432f42b68e6840548b.tar.gz | |
Merge "Support remote-address-group in SG rules"
Diffstat (limited to 'openstackclient/network')
| -rw-r--r-- | openstackclient/network/v2/security_group_rule.py | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/openstackclient/network/v2/security_group_rule.py b/openstackclient/network/v2/security_group_rule.py index a7703933..17241ed2 100644 --- a/openstackclient/network/v2/security_group_rule.py +++ b/openstackclient/network/v2/security_group_rule.py @@ -126,6 +126,12 @@ class CreateSecurityGroupRule(common.NetworkAndComputeShowOne): metavar="<group>", help=_("Remote security group (name or ID)"), ) + if self.is_neutron: + remote_group.add_argument( + "--remote-address-group", + metavar="<group>", + help=_("Remote address group (name or ID)"), + ) # NOTE(efried): The --dst-port, --protocol, and --proto options exist # for both nova-network and neutron, but differ slightly. For the sake @@ -328,6 +334,11 @@ class CreateSecurityGroupRule(common.NetworkAndComputeShowOne): parsed_args.remote_group, ignore_missing=False ).id + elif parsed_args.remote_address_group is not None: + attrs['remote_address_group_id'] = client.find_address_group( + parsed_args.remote_address_group, + ignore_missing=False + ).id elif parsed_args.remote_ip is not None: attrs['remote_ip_prefix'] = parsed_args.remote_ip elif attrs['ethertype'] == 'IPv4': @@ -507,6 +518,8 @@ class ListSecurityGroupRule(common.NetworkAndComputeLister): 'Direction', 'Remote Security Group', ) + if self.is_neutron: + column_headers = column_headers + ('Remote Address Group',) if parsed_args.group is None: column_headers = column_headers + ('Security Group',) return column_headers @@ -526,6 +539,7 @@ class ListSecurityGroupRule(common.NetworkAndComputeLister): 'port_range', 'direction', 'remote_group_id', + 'remote_address_group_id', ) # Get the security group rules using the requested query. |
