← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1674069] Re: TypeError: add_router_interface() takes exactly 4 arguments (3 given)

 

Reviewed:  https://review.openstack.org/447266
Committed: https://git.openstack.org/cgit/openstack/neutron/commit/?id=0e99b057dff08b37bd48bbd4f3aaf970ced2dffd
Submitter: Jenkins
Branch:    master

commit 0e99b057dff08b37bd48bbd4f3aaf970ced2dffd
Author: liyingjun <yingjun.li@xxxxxxxxxxxxxxx>
Date:   Sun Mar 19 16:42:17 2017 +0800

    Handle empty body in add_router_interface
    
    when passing an empty dict body {} to add_router_interface[1], internal
    server error will be raised.
    There is argument check in the cli which checks either subnet or port id
    is needed, but not in the server side when the body is empty.
    
    [1]:
    https://developer.openstack.org/api-ref/networking/v2/?expanded=add-interface-to-router-detail
    
    Change-Id: Iad48dadb1235bc45787a1e87ff3f0d7a21df18af
    Closes-bug: #1674069


** Changed in: neutron
       Status: In Progress => Fix Released

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to neutron.
https://bugs.launchpad.net/bugs/1674069

Title:
  TypeError: add_router_interface() takes exactly 4 arguments (3 given)

Status in neutron:
  Fix Released

Bug description:
  when passing an empty dict body {} to add_router_interface[1], internal server will be raised.
  There is argument check in the cli which checks either subnet or port id is needed, but not in the server side.

  
  2017-03-19 16:20:04.416 ERROR neutron.api.v2.resource [req-1aa5a367-a153-4634-8075-704f8ef9cfaf demo admin] add_router_interface failed: No details.
  2017-03-19 16:20:04.416 TRACE neutron.api.v2.resource Traceback (most recent call last):
  2017-03-19 16:20:04.416 TRACE neutron.api.v2.resource   File "/opt/stack/neutron/neutron/api/v2/resource.py", line 79, in resource
  2017-03-19 16:20:04.416 TRACE neutron.api.v2.resource     result = method(request=request, **args)
  2017-03-19 16:20:04.416 TRACE neutron.api.v2.resource   File "/opt/stack/neutron/neutron/db/api.py", line 92, in wrapped
  2017-03-19 16:20:04.416 TRACE neutron.api.v2.resource     setattr(e, '_RETRY_EXCEEDED', True)
  2017-03-19 16:20:04.416 TRACE neutron.api.v2.resource   File "/usr/local/lib/python2.7/dist-packages/oslo_utils/excutils.py", line 220, in __exit__
  2017-03-19 16:20:04.416 TRACE neutron.api.v2.resource     self.force_reraise()
  2017-03-19 16:20:04.416 TRACE neutron.api.v2.resource   File "/usr/local/lib/python2.7/dist-packages/oslo_utils/excutils.py", line 196, in force_reraise
  2017-03-19 16:20:04.416 TRACE neutron.api.v2.resource     six.reraise(self.type_, self.value, self.tb)
  2017-03-19 16:20:04.416 TRACE neutron.api.v2.resource   File "/opt/stack/neutron/neutron/db/api.py", line 88, in wrapped
  2017-03-19 16:20:04.416 TRACE neutron.api.v2.resource     return f(*args, **kwargs)
  2017-03-19 16:20:04.416 TRACE neutron.api.v2.resource   File "/usr/local/lib/python2.7/dist-packages/oslo_db/api.py", line 151, in wrapper
  2017-03-19 16:20:04.416 TRACE neutron.api.v2.resource     ectxt.value = e.inner_exc
  2017-03-19 16:20:04.416 TRACE neutron.api.v2.resource   File "/usr/local/lib/python2.7/dist-packages/oslo_utils/excutils.py", line 220, in __exit__
  2017-03-19 16:20:04.416 TRACE neutron.api.v2.resource     self.force_reraise()
  2017-03-19 16:20:04.416 TRACE neutron.api.v2.resource   File "/usr/local/lib/python2.7/dist-packages/oslo_utils/excutils.py", line 196, in force_reraise
  2017-03-19 16:20:04.416 TRACE neutron.api.v2.resource     six.reraise(self.type_, self.value, self.tb)
  2017-03-19 16:20:04.416 TRACE neutron.api.v2.resource   File "/usr/local/lib/python2.7/dist-packages/oslo_db/api.py", line 139, in wrapper
  2017-03-19 16:20:04.416 TRACE neutron.api.v2.resource     return f(*args, **kwargs)
  2017-03-19 16:20:04.416 TRACE neutron.api.v2.resource   File "/opt/stack/neutron/neutron/db/api.py", line 128, in wrapped
  2017-03-19 16:20:04.416 TRACE neutron.api.v2.resource     traceback.format_exc())
  2017-03-19 16:20:04.416 TRACE neutron.api.v2.resource   File "/usr/local/lib/python2.7/dist-packages/oslo_utils/excutils.py", line 220, in __exit__
  2017-03-19 16:20:04.416 TRACE neutron.api.v2.resource     self.force_reraise()
  2017-03-19 16:20:04.416 TRACE neutron.api.v2.resource   File "/usr/local/lib/python2.7/dist-packages/oslo_utils/excutils.py", line 196, in force_reraise
  2017-03-19 16:20:04.416 TRACE neutron.api.v2.resource     six.reraise(self.type_, self.value, self.tb)
  2017-03-19 16:20:04.416 TRACE neutron.api.v2.resource   File "/opt/stack/neutron/neutron/db/api.py", line 123, in wrapped
  2017-03-19 16:20:04.416 TRACE neutron.api.v2.resource     return f(*dup_args, **dup_kwargs)
  2017-03-19 16:20:04.416 TRACE neutron.api.v2.resource   File "/opt/stack/neutron/neutron/api/v2/base.py", line 258, in _handle_action
  2017-03-19 16:20:04.416 TRACE neutron.api.v2.resource     ret_value = getattr(self._plugin, name)(*arg_list, **kwargs)
  2017-03-19 16:20:04.416 TRACE neutron.api.v2.resource TypeError: add_router_interface() takes exactly 4 arguments (3 given)
  2017-03-19 16:20:04.416 TRACE neutron.api.v2.resource
  2017-03-19 16:20:04.426 INFO neutron.wsgi [req-1aa5a367-a153-4634-8075-704f8ef9cfaf demo admin] 172.16.46.129 - - [19/Mar/2017 16:20:04] "PUT /v2.0/routers/d68763bd-6a93-4262-9e50-b9da7e4256f8/add_router_interface.json HTTP/1.1" 500 368 0.097819

  [1]: https://developer.openstack.org/api-ref/networking/v2/?expanded
  =add-interface-to-router-detail

To manage notifications about this bug go to:
https://bugs.launchpad.net/neutron/+bug/1674069/+subscriptions


References