fixed_ip object associate method doesn't handle an IPAddress object field

Bug #1317668 reported by Andrew Laski
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Undecided
Andrew Laski

Bug Description

When an nova.objects.fields:IPAddress or subclass is passed to a fixed_ip object associate method the following traceback occurs:

Traceback (most recent call last):
  File "/home/alaski/dev/nova/.tox/py27/local/lib/python2.7/site-packages/eventlet/queue.py", line 107, in switch
    self.greenlet.switch(value)
  File "/home/alaski/dev/nova/.tox/py27/local/lib/python2.7/site-packages/eventlet/greenthread.py", line 194, in main
    result = function(*args, **kwargs)
  File "/home/alaski/dev/nova/nova/compute/manager.py", line 1547, in _allocate_network_async
    dhcp_options=dhcp_options)
  File "/home/alaski/dev/nova/nova/network/api.py", line 46, in wrapped
    return func(self, context, *args, **kwargs)
  File "/home/alaski/dev/nova/nova/network/base_api.py", line 59, in wrapper
    res = f(self, context, *args, **kwargs)
  File "/home/alaski/dev/nova/nova/network/api.py", line 253, in allocate_for_instance
    nw_info = self.network_rpcapi.allocate_for_instance(context, **args)
  File "/home/alaski/dev/nova/nova/network/rpcapi.py", line 175, in allocate_for_instance
    macs=jsonutils.to_primitive(macs))
  File "/home/alaski/dev/nova/.tox/py27/local/lib/python2.7/site-packages/oslo/messaging/rpc/client.py", line 150, in call
    wait_for_reply=True, timeout=timeout)
  File "/home/alaski/dev/nova/.tox/py27/local/lib/python2.7/site-packages/oslo/messaging/transport.py", line 87, in _send
    timeout=timeout)
  File "/home/alaski/dev/nova/.tox/py27/local/lib/python2.7/site-packages/oslo/messaging/_drivers/impl_fake.py", line 146, in send
    return self._send(target, ctxt, message, wait_for_reply, timeout)
  File "/home/alaski/dev/nova/.tox/py27/local/lib/python2.7/site-packages/oslo/messaging/_drivers/impl_fake.py", line 136, in _send
    raise failure
InterfaceError: (InterfaceError) Error binding parameter 2 - probably unsupported type. u'SELECT fixed_ips.created_at AS fixed_ips_created_at, fixed_ips.updated_at AS fixed_ips_updated_at, fixed_ips.deleted_at AS fixed_ips_deleted_at, fixed_ips.deleted AS fixed_ips_deleted, fixed_ips.id AS fixed_ips_id, fixed_ips.address AS fixed_ips_address, fixed_ips.network_id AS fixed_ips_network_id, fixed_ips.virtual_interface_id AS fixed_ips_virtual_interface_id, fixed_ips.instance_uuid AS fixed_ips_instance_uuid, fixed_ips.allocated AS fixed_ips_allocated, fixed_ips.leased AS fixed_ips_leased, fixed_ips.reserved AS fixed_ips_reserved, fixed_ips.host AS fixed_ips_host \nFROM fixed_ips \nWHERE fixed_ips.deleted = ? AND (fixed_ips.network_id = ? OR fixed_ips.network_id IS NULL) AND fixed_ips.reserved = 1 AND fixed_ips.address = ?\n LIMIT ? OFFSET ?' (0, 1, IPAddress('10.0.0.2'), 1, 0)

Revision history for this message
Andrew Laski (alaski) wrote :

I should add that this is triggered when allocate_fixed_ip in network manager is called with a vpn network. This occurs during the CloudPipe api samples tests but isn't triggered until after the instance is created so the error is silently ignored.

Andrew Laski (alaski)
Changed in nova:
assignee: nobody → Andrew Laski (alaski)
Changed in nova:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

Reviewed: https://review.openstack.org/92927
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=5268c1136ed09346d13b28b42626c0b302e3abb2
Submitter: Jenkins
Branch: master

commit 5268c1136ed09346d13b28b42626c0b302e3abb2
Author: Andrew Laski <email address hidden>
Date: Thu May 8 18:27:05 2014 -0400

    Convert address to str in fixed_ip_obj.associate

    A caller of associate may pass in a netaddr.IPAddress argument which
    will currently fail when it gets to sqlalchemy. Following the
    convention of other methods the netaddr.IPAddress will be cast to a
    string.

    Change-Id: I67c1876b447217b37104660ba87ed967f477b863
    Closes-bug: 1317668

Changed in nova:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in nova:
milestone: none → juno-1
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in nova:
milestone: juno-1 → 2014.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.