No error is returned if public interface doesn't exist

Bug #845507 reported by Mark McLoughlin on 2011-09-09
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Dean Troyer

Bug Description

With the eth0 default for public_interface on a Fedora machine whose primary interface is named em0, I get no errors when associating a floating IP with an instance even though it clearly fails:

  DEBUG nova.utils [-] Running cmd (subprocess): sudo ip addr add dev eth0 from (pid=1918) execute /usr/lib/python2.7/site-packages/nova/
  DEBUG nova.utils [-] Result was 255 from (pid=1918) execute /usr/lib/python2.7/site-packages/nova/

The problem is here:

  # NOTE(vish): The False here is because we ignore the case
  # that the ip is already bound.
  self.driver.bind_floating_ip(floating_ip['address'], False)

i.e. we want to ignore one specific error, not all errors

Thierry Carrez (ttx) on 2011-10-21
Changed in nova:
importance: Undecided → Low
status: New → Confirmed
Dean Troyer (dtroyer) on 2012-01-23
Changed in nova:
assignee: nobody → Dean Troyer (dtroyer)
status: Confirmed → In Progress
Vish Ishaya (vishvananda) wrote :

FYI, this is changed now to only ignore the specific case that the ip is bound already (exit code 254)

36 def bind_floating_ip(floating_ip, device):
 437 """Bind ip to public interface."""
 438 _execute('ip', 'addr', 'add', str(floating_ip) + '/32',
 439 'dev', device,
 440 run_as_root=True, check_exit_code=[0, 254])

That said, the fixes dean adden in the above branch are still useful for returning a useful error to the user.

Submitter: Jenkins
Branch: master

commit 8279240ee30d55d127e4d964a9861b721ac7cc74
Author: Dean Troyer <email address hidden>
Date: Fri Jan 20 16:39:41 2012 -0600

    Handle error in associate floating IP (bug 845507)

    * Raise NoFloatingIpInterface when associate floating IP has an
      interface that doesn't exist.
    * Return 500 Internal server Error, indicate only that associate
      action failed

    Change-Id: I6b032f7554795de64bce8e669d20269210c62e33

Changed in nova:
status: In Progress → Fix Committed
Thierry Carrez (ttx) on 2012-01-25
Changed in nova:
milestone: none → essex-3
status: Fix Committed → Fix Released
Thierry Carrez (ttx) on 2012-04-05
Changed in nova:
milestone: essex-3 → 2012.1
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers