← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1131430] Re: API for baremetal nodes fails if node has no interfaces

 

** Changed in: nova
       Status: Fix Committed => Fix Released

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to OpenStack Compute (nova).
https://bugs.launchpad.net/bugs/1131430

Title:
  API for baremetal nodes fails if node has no interfaces

Status in OpenStack Compute (Nova):
  Fix Released

Bug description:
  If a baremetal node is created, but has no interfaces associated with
  it, API calls to list all nodes, show that node, or delete that node
  will fail until an interface is associated with it.

  These API calls should work regardless of whether the node has any
  interfaces associated.

  Errors from python-novaclient:

  $ nova baremetal-node-list
  ERROR: The resource could not be found. (HTTP 404) (Request-ID: req-11cc3b25-0b08-4b48-afa8-849a071a6ab9)
  $ nova baremetal-node-delete 1
  ERROR: No baremetalnode with a name or ID of '1' exists.

  
  Error in nova-api:

  2013-02-21 21:52:26.215 TRACE nova.api.openstack   File "/opt/stack/nova/nova/api/openstack/compute/contrib/baremetal_nodes.py", line 106, in index
  2013-02-21 21:52:26.215 TRACE nova.api.openstack     context, node_from_db['id'])
  2013-02-21 21:52:26.215 TRACE nova.api.openstack   File "/opt/stack/nova/nova/virt/baremetal/db/api.py", line 186, in bm_interface_get_all_by_bm_node_id
  2013-02-21 21:52:26.215 TRACE nova.api.openstack     return IMPL.bm_interface_get_all_by_bm_node_id(context, bm_node_id)
  2013-02-21 21:52:26.215 TRACE nova.api.openstack   File "/opt/stack/nova/nova/db/sqlalchemy/api.py", line 95, in wrapper
  2013-02-21 21:52:26.215 TRACE nova.api.openstack     return f(*args, **kwargs)
  2013-02-21 21:52:26.215 TRACE nova.api.openstack   File "/opt/stack/nova/nova/virt/baremetal/db/sqlalchemy/api.py", line 428, in bm_interface_get_all_by_bm_node_id
  2013-02-21 21:52:26.215 TRACE nova.api.openstack     raise exception.NodeNotFound(node_id=bm_node_id)
  2013-02-21 21:52:26.215 TRACE nova.api.openstack NodeNotFound: Node 1 could not be found.

  
  The fix is simple: don't raise an exception in bm_interface_get_all_by_bm_node_id when there are no interfaces for that node id.

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