Fix TypeError in api/neutron.py
In api/neutron.py [1], there is a logging, which throws a TypeError, because the arguments of the format message is passed as a tuple, which is not working when you pass the arguments to the logger, instead of replacing in-place. In the current code, running the log message leds to the following: TypeError: not enough arguments for format string Call stack: File "test.py", line 9, in <module> "router=%s", (router_id, router)) Message: 'router_static_route_list(): router_id=%s, router=%s' Arguments: (('asd', 'asdf'),) In this patchset, this bug is fixed. [1]: https://github.com/openstack/horizon/blob/master/openstack_dashboard/api/neutron.py#L1079 Change-Id: I233c435bb7ca89c6c8ecd49a66bccb5b59eedf41 Closes-Bug: #1659342
This commit is contained in:
parent
f9c6b43db2
commit
41ee8c0677
|
@ -1076,8 +1076,9 @@ def router_static_route_list(request, router_id=None):
|
||||||
try:
|
try:
|
||||||
routes = [RouterStaticRoute(r) for r in router.routes]
|
routes = [RouterStaticRoute(r) for r in router.routes]
|
||||||
except AttributeError:
|
except AttributeError:
|
||||||
LOG.debug("router_static_route_list(): router_id=%s, "
|
LOG.debug("router_static_route_list(): router_id=%(router_id)s, "
|
||||||
"router=%s", (router_id, router))
|
"router=%(router)s", {'router_id': router_id,
|
||||||
|
'router': router})
|
||||||
return []
|
return []
|
||||||
return routes
|
return routes
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue