← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1208059] Re: _hold_ip logic in NeutronDbPluginV2 is broken

 

This issue was fixed by https://review.openstack.org/#/c/37580/

** 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/1208059

Title:
  _hold_ip logic in NeutronDbPluginV2 is broken

Status in OpenStack Neutron (virtual network service):
  Fix Released

Bug description:
  Jumping straight to the code:

  (In neutron/db/db_base_plugin_v2.py)

  def _hold_ip(context, network_id, subnet_id, port_id, ip_address):
  .....
         allocated = alloc_qry.filter_by(network_id=network_id,
                                          port_id=port_id,
                                          ip_address=ip_address,
                                          subnet_id=subnet_id).one()

          if not allocated:
              return
  .....

  SqlAlchemy one() raises either NoResultFound or MultipleResultsFound.
  Checking "allocated" doesn't seem to make sense here, unless I am missing something.

  The only question I have is what to do when (if ever) multiple results
  are returned. Should I let it raise or just return ?

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