deallocate_fixed_ip called incorrectly

Bug #1024789 reported by Mohammed Naser
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Undecided
Yun Mao

Bug Description

When calling remove-fixed-ip on an instance using FlatManager, the following exception is raised

2012-07-14 20:13:48 ERROR nova.openstack.common.rpc.amqp [-] Exception during message handling
2012-07-14 20:13:48 TRACE nova.openstack.common.rpc.amqp Traceback (most recent call last):
2012-07-14 20:13:48 TRACE nova.openstack.common.rpc.amqp File "/usr/local/lib/python2.7/dist-packages/nova-2012.2-py2.7.egg/nova/openstack/common/rpc/amqp.py", line 274, in _process_data
2012-07-14 20:13:48 TRACE nova.openstack.common.rpc.amqp rval = self.proxy.dispatch(ctxt, version, method, **args)
2012-07-14 20:13:48 TRACE nova.openstack.common.rpc.amqp File "/usr/local/lib/python2.7/dist-packages/nova-2012.2-py2.7.egg/nova/openstack/common/rpc/dispatcher.py", line 145, in dispatch
2012-07-14 20:13:48 TRACE nova.openstack.common.rpc.amqp return getattr(proxyobj, method)(ctxt, **kwargs)
2012-07-14 20:13:48 TRACE nova.openstack.common.rpc.amqp File "/usr/local/lib/python2.7/dist-packages/nova-2012.2-py2.7.egg/nova/network/manager.py", line 262, in wrapped
2012-07-14 20:13:48 TRACE nova.openstack.common.rpc.amqp return func(self, context, *args, **kwargs)
2012-07-14 20:13:48 TRACE nova.openstack.common.rpc.amqp File "/usr/local/lib/python2.7/dist-packages/nova-2012.2-py2.7.egg/nova/network/manager.py", line 1193, in remove_fixed_ip_from_instance
2012-07-14 20:13:48 TRACE nova.openstack.common.rpc.amqp self.deallocate_fixed_ip(context, address, host)
2012-07-14 20:13:48 TRACE nova.openstack.common.rpc.amqp TypeError: deallocate_fixed_ip() takes exactly 3 arguments (4 given)

It seems that the function was changed but not refactored in there.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (master)

Fix proposed to branch: master
Review: https://review.openstack.org/9832

Changed in nova:
assignee: nobody → Mohammed Naser (mnaser)
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Fix proposed to branch: master
Review: https://review.openstack.org/11901

Changed in nova:
assignee: Mohammed Naser (mnaser) → Yun Mao (yunmao)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

Reviewed: https://review.openstack.org/11901
Committed: http://github.com/openstack/nova/commit/32b0346eb40a94ec6def3eed01e9424b0c660c53
Submitter: Jenkins
Branch: master

commit 32b0346eb40a94ec6def3eed01e9424b0c660c53
Author: Yun Mao <email address hidden>
Date: Thu Aug 23 16:37:42 2012 -0400

    Fix deallocate_fixed_ip() call by unifying signature

    deallocate_fixed_ip() is defined in 3 classes with incompatible
    signatures:

    RPCAllocateFixedIP:
    deallocate_fixed_ip(self, context, address, host, **kwargs)
    NetworkManager:
    deallocate_fixed_ip(self, context, address, **kwargs)
    FlatManager:
    deallocate_fixed_ip(self, context, address, **kwargs)

    There is a non-trivial multiple inheritance relationship among
    them. The complication leads to incorrect function call signatures
    (see bug 1024789). The kwargs magic is also never used, and discarded
    during rpc calls anyway.

    This patch makes the call signature exactly the same for all
    deallocate_fixed_ip() definitions, drops kwargs and fixes bug
    1024789.

    Change-Id: I9c139810d4a5c93fa9f50b89a07bfe44e73e6c8a

Changed in nova:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in nova:
milestone: none → folsom-rc1
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in nova:
milestone: folsom-rc1 → 2012.2
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.