summaryrefslogtreecommitdiff
path: root/openstackclient/network
diff options
context:
space:
mode:
authorChoe, Cheng-Dae <whitekid@gmail.com>2016-10-08 02:50:25 +0900
committerChoe, Cheng-Dae <whitekid@gmail.com>2016-10-10 23:57:22 +0900
commit2bbb482106d9ec97537d4604096a3fca1ddae2d4 (patch)
tree6b94a8c1a3b1220c717af797589d9ae83dc96ac4 /openstackclient/network
parent762f2f2c34814b8bfc615696918d8cb49b93a1dd (diff)
downloadpython-openstackclient-2bbb482106d9ec97537d4604096a3fca1ddae2d4.tar.gz
Fix router unset --route option
Fix the "--route" option one the "os route unset" command. The option did not convert gateway to nexthop which results "Router does not contain route" error. Change-Id: Ia57bc7ea77ad7c6030535180a6ce42b4928c9e56 Closes-Bug: 1631471
Diffstat (limited to 'openstackclient/network')
-rw-r--r--openstackclient/network/v2/router.py3
1 files changed, 1 insertions, 2 deletions
diff --git a/openstackclient/network/v2/router.py b/openstackclient/network/v2/router.py
index 48a3a92c..64bb8819 100644
--- a/openstackclient/network/v2/router.py
+++ b/openstackclient/network/v2/router.py
@@ -520,12 +520,11 @@ class UnsetRouter(command.Command):
if parsed_args.routes:
try:
for route in parsed_args.routes:
+ route['nexthop'] = route.pop('gateway')
tmp_routes.remove(route)
except ValueError:
msg = (_("Router does not contain route %s") % route)
raise exceptions.CommandError(msg)
- for route in tmp_routes:
- route['nexthop'] = route.pop('gateway')
attrs['routes'] = tmp_routes
if attrs:
client.update_router(obj, **attrs)