diff options
| author | Sean McGinnis <sean.mcginnis@gmail.com> | 2018-10-26 11:50:32 -0500 |
|---|---|---|
| committer | Dean Troyer <dtroyer@gmail.com> | 2019-05-19 18:22:26 -0500 |
| commit | 5a0fc68a87d1c9733c1dd5bb6f68b2e518fe2105 (patch) | |
| tree | ee31c8f9779ce7db312cde423d67c7cbc29ad548 /openstackclient/network/v2/security_group_rule.py | |
| parent | 67dadda746759d8cf47822e6f426c473e46acc27 (diff) | |
| download | python-openstackclient-5a0fc68a87d1c9733c1dd5bb6f68b2e518fe2105.tar.gz | |
Remove deprecated network options
The following were deprecated for several releases and can now be
removed:
* Remove ``port create|set`` options ``--device-id`` and ``--port-id``
* Remove ``router set`` option ``--clear-routes``
* Remove ``security group rule create`` options ``--src-group`` and ``--src-ip``
These are backwards incompatible changes and will require a major
version bump after they are merged.
Change-Id: Ieae74c14f6b3e263721a3146cf76f94a9ab792f6
Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com>
Signed-off-by: Dean Troyer <dtroyer@gmail.com>
Diffstat (limited to 'openstackclient/network/v2/security_group_rule.py')
| -rw-r--r-- | openstackclient/network/v2/security_group_rule.py | 63 |
1 files changed, 8 insertions, 55 deletions
diff --git a/openstackclient/network/v2/security_group_rule.py b/openstackclient/network/v2/security_group_rule.py index 961125a9..df19af20 100644 --- a/openstackclient/network/v2/security_group_rule.py +++ b/openstackclient/network/v2/security_group_rule.py @@ -115,19 +115,6 @@ class CreateSecurityGroupRule(common.NetworkAndComputeShowOne): metavar="<group>", help=_("Remote security group (name or ID)"), ) - # Handle deprecated options - # NOTE(dtroyer): --src-ip and --src-group were deprecated in Nov 2016. - # Do not remove before 4.x release or Nov 2017. - remote_group.add_argument( - "--src-ip", - metavar="<ip-address>", - help=argparse.SUPPRESS, - ) - remote_group.add_argument( - "--src-group", - metavar="<group>", - help=argparse.SUPPRESS, - ) return parser def update_parser_network(self, parser): @@ -310,31 +297,13 @@ class CreateSecurityGroupRule(common.NetworkAndComputeShowOne): if parsed_args.icmp_code is not None and parsed_args.icmp_code >= 0: attrs['port_range_max'] = parsed_args.icmp_code - # NOTE(dtroyer): --src-ip and --src-group were deprecated in Nov 2016. - # Do not remove before 4.x release or Nov 2017. - if not (parsed_args.remote_group is None and - parsed_args.src_group is None): + if parsed_args.remote_group is not None: attrs['remote_group_id'] = client.find_security_group( - parsed_args.remote_group or parsed_args.src_group, + parsed_args.remote_group, ignore_missing=False ).id - if parsed_args.src_group: - LOG.warning( - _("The %(old)s option is deprecated, " - "please use %(new)s instead."), - {'old': '--src-group', 'new': '--remote-group'}, - ) - elif not (parsed_args.remote_ip is None and - parsed_args.src_ip is None): - attrs['remote_ip_prefix'] = ( - parsed_args.remote_ip or parsed_args.src_ip - ) - if parsed_args.src_ip: - LOG.warning( - _("The %(old)s option is deprecated, " - "please use %(new)s instead."), - {'old': '--src-ip', 'new': '--remote-ip'}, - ) + elif parsed_args.remote_ip is not None: + attrs['remote_ip_prefix'] = parsed_args.remote_ip elif attrs['ethertype'] == 'IPv4': attrs['remote_ip_prefix'] = '0.0.0.0/0' attrs['security_group_id'] = security_group_id @@ -361,29 +330,13 @@ class CreateSecurityGroupRule(common.NetworkAndComputeShowOne): else: from_port, to_port = parsed_args.dst_port - # NOTE(dtroyer): --src-ip and --src-group were deprecated in Nov 2016. - # Do not remove before 4.x release or Nov 2017. remote_ip = None - if not (parsed_args.remote_group is None and - parsed_args.src_group is None): + if parsed_args.remote_group is not None: parsed_args.remote_group = client.api.security_group_find( - parsed_args.remote_group or parsed_args.src_group, + parsed_args.remote_group, )['id'] - if parsed_args.src_group: - LOG.warning( - _("The %(old)s option is deprecated, " - "please use %(new)s instead."), - {'old': '--src-group', 'new': '--remote-group'}, - ) - if not (parsed_args.remote_ip is None and - parsed_args.src_ip is None): - remote_ip = parsed_args.remote_ip or parsed_args.src_ip - if parsed_args.src_ip: - LOG.warning( - _("The %(old)s option is deprecated, " - "please use %(new)s instead."), - {'old': '--src-ip', 'new': '--remote-ip'}, - ) + if parsed_args.remote_ip is not None: + remote_ip = parsed_args.remote_ip else: remote_ip = '0.0.0.0/0' |
