diff options
| author | Zuul <zuul@review.opendev.org> | 2019-06-21 23:00:59 +0000 |
|---|---|---|
| committer | Gerrit Code Review <review@openstack.org> | 2019-06-21 23:00:59 +0000 |
| commit | 1d6e24246aad76f1f390577bf2118fa67cde08ce (patch) | |
| tree | 132f0647f85b3afe062a0bc0ca01928ed9d29922 /openstackclient/network/v2/router.py | |
| parent | 3161f87c44b200eb5fe5d540d5c75136190ac455 (diff) | |
| parent | 5a0fc68a87d1c9733c1dd5bb6f68b2e518fe2105 (diff) | |
| download | python-openstackclient-1d6e24246aad76f1f390577bf2118fa67cde08ce.tar.gz | |
Merge "Remove deprecated network options"
Diffstat (limited to 'openstackclient/network/v2/router.py')
| -rw-r--r-- | openstackclient/network/v2/router.py | 19 |
1 files changed, 3 insertions, 16 deletions
diff --git a/openstackclient/network/v2/router.py b/openstackclient/network/v2/router.py index 2ec3e2f0..13de66aa 100644 --- a/openstackclient/network/v2/router.py +++ b/openstackclient/network/v2/router.py @@ -13,7 +13,6 @@ """Router action implementations""" -import argparse import copy import json import logging @@ -528,8 +527,6 @@ class SetRouter(command.Command): action='store_true', help=_("Set router to centralized mode (disabled router only)") ) - routes_group = parser.add_mutually_exclusive_group() - # ToDo(Reedip):Remove mutual exclusiveness once clear-routes is removed parser.add_argument( '--route', metavar='destination=<subnet>,gateway=<ip-address>', @@ -542,18 +539,13 @@ class SetRouter(command.Command): "gateway: nexthop IP address " "(repeat option to set multiple routes)") ) - routes_group.add_argument( + parser.add_argument( '--no-route', action='store_true', help=_("Clear routes associated with the router. " "Specify both --route and --no-route to overwrite " "current value of route.") ) - routes_group.add_argument( - '--clear-routes', - action='store_true', - help=argparse.SUPPRESS, - ) routes_ha = parser.add_mutually_exclusive_group() routes_ha.add_argument( '--ha', @@ -619,21 +611,16 @@ class SetRouter(command.Command): attrs['ha'] = True elif parsed_args.no_ha: attrs['ha'] = False - if parsed_args.clear_routes: - LOG.warning(_( - 'The --clear-routes option is deprecated, ' - 'please use --no-route instead.' - )) if parsed_args.routes is not None: for route in parsed_args.routes: route['nexthop'] = route.pop('gateway') attrs['routes'] = parsed_args.routes - if not (parsed_args.no_route or parsed_args.clear_routes): + if not parsed_args.no_route: # Map the route keys and append to the current routes. # The REST API will handle route validation and duplicates. attrs['routes'] += obj.routes - elif parsed_args.no_route or parsed_args.clear_routes: + elif parsed_args.no_route: attrs['routes'] = [] if (parsed_args.disable_snat or parsed_args.enable_snat or parsed_args.fixed_ip) and not parsed_args.external_gateway: |
