Nova API os-hosts extension broken

Bug #960226 reported by Unmesh Gurjar
14
This bug affects 3 people
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
High
Chris Behrens
Essex
Fix Released
High
Unassigned

Bug Description

Scenario: Update the status of a host using the os-hosts extension.

Branch: master
Request URL: http://127.0.0.1:8774/v2/03dce75fed734c019d87f30e738a0273/os-hosts/ubuntu-devstack
Request Body: {"status": "disable"}

Expected Result: The host status must be updated to 'disabled'.
Actual Result: API call fails with a 500 Internal Server Error.

Stack Trace:
    2012-03-20 05:15:01 ERROR nova.api.openstack [req-406770bf-4f57-4907-8ac4-1e8d52412321 f9e618906d8f479f800347a0f5db88f7 03dce75fed734c019d87f30e738a0273] Caught error:
    'HostAPI' object has no attribute '_call_compute_message'
    (nova.api.openstack): TRACE: Traceback (most recent call last):
    (nova.api.openstack): TRACE: File "/opt/stack/nova/nova/api/openstack/__init__.py", line 41, in __call__
    (nova.api.openstack): TRACE: return req.get_response(self.application)
    (nova.api.openstack): TRACE: File "/usr/lib/python2.7/dist-packages/webob/request.py", line 1053, in get_response
    (nova.api.openstack): TRACE: application, catch_exc_info=False)
    (nova.api.openstack): TRACE: File "/usr/lib/python2.7/dist-packages/webob/request.py", line 1022, in call_application
    (nova.api.openstack): TRACE: app_iter = application(self.environ, start_response)
    (nova.api.openstack): TRACE: File "/opt/stack/keystone/keystone/middleware/auth_token.py", line 176, in __call__
    (nova.api.openstack): TRACE: return self.app(env, start_response)
    (nova.api.openstack): TRACE: File "/usr/lib/python2.7/dist-packages/webob/dec.py", line 159, in __call__
    (nova.api.openstack): TRACE: return resp(environ, start_response)
    (nova.api.openstack): TRACE: File "/usr/lib/python2.7/dist-packages/webob/dec.py", line 159, in __call__
    (nova.api.openstack): TRACE: return resp(environ, start_response)
    (nova.api.openstack): TRACE: File "/usr/lib/python2.7/dist-packages/webob/dec.py", line 159, in __call__
    (nova.api.openstack): TRACE: return resp(environ, start_response)
    (nova.api.openstack): TRACE: File "/usr/lib/pymodules/python2.7/routes/middleware.py", line 131, in __call__
    (nova.api.openstack): TRACE: response = self.app(environ, start_response)
    (nova.api.openstack): TRACE: File "/usr/lib/python2.7/dist-packages/webob/dec.py", line 159, in __call__
    (nova.api.openstack): TRACE: return resp(environ, start_response)
    (nova.api.openstack): TRACE: File "/usr/lib/python2.7/dist-packages/webob/dec.py", line 147, in __call__
    (nova.api.openstack): TRACE: resp = self.call_func(req, *args, **self.kwargs)
    (nova.api.openstack): TRACE: File "/usr/lib/python2.7/dist-packages/webob/dec.py", line 208, in call_func
    (nova.api.openstack): TRACE: return self.func(req, *args, **kwargs)
    (nova.api.openstack): TRACE: File "/opt/stack/nova/nova/api/openstack/wsgi.py", line 803, in __call__
    (nova.api.openstack): TRACE: content_type, body, accept)
    (nova.api.openstack): TRACE: File "/opt/stack/nova/nova/api/openstack/wsgi.py", line 851, in _process_stack
    (nova.api.openstack): TRACE: action_result = self.dispatch(meth, request, action_args)
    (nova.api.openstack): TRACE: File "/opt/stack/nova/nova/api/openstack/wsgi.py", line 926, in dispatch
    (nova.api.openstack): TRACE: return method(req=request, **action_args)
    (nova.api.openstack): TRACE: File "/opt/stack/nova/nova/api/openstack/compute/contrib/hosts.py", line 114, in wrapped
    (nova.api.openstack): TRACE: return fn(self, req, id, *args, **kwargs)
    (nova.api.openstack): TRACE: File "/opt/stack/nova/nova/api/openstack/compute/contrib/hosts.py", line 163, in update
    (nova.api.openstack): TRACE: result.update(update_setters[key](req, id, value))
    (nova.api.openstack): TRACE: File "/opt/stack/nova/nova/api/openstack/compute/contrib/hosts.py", line 183, in _set_enabled_status
    (nova.api.openstack): TRACE: enabled=enabled)
    (nova.api.openstack): TRACE: File "/opt/stack/nova/nova/compute/api.py", line 1689, in set_host_enabled
    (nova.api.openstack): TRACE: return self._call_compute_message("set_host_enabled", context,
    (nova.api.openstack): TRACE: AttributeError: 'HostAPI' object has no attribute '_call_compute_message'
    (nova.api.openstack): TRACE:

Tags: ntt
Changed in nova:
assignee: nobody → Unmesh Gurjar (unmesh-gurjar)
Revision history for this message
Armando Migliaccio (armando-migliaccio) wrote :

the chain of events that brought to this can be tracked down here:

https://review.openstack.org/#change,5252

Revision history for this message
Brian Waldon (bcwaldon) wrote :

This also applies to the startup, shutdown, and reboot actions this extension provides.

Chris Behrens (cbehrens)
Changed in nova:
assignee: Unmesh Gurjar (unmesh-gurjar) → Chris Behrens (cbehrens)
status: New → In Progress
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/6382

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

Reviewed: https://review.openstack.org/6382
Committed: http://github.com/openstack/nova/commit/1478aa3478d50c587913e095f4ee14746b54dc98
Submitter: Jenkins
Branch: master

commit 1478aa3478d50c587913e095f4ee14746b54dc98
Author: Chris Behrens <email address hidden>
Date: Mon Apr 9 19:23:03 2012 +0000

    Create compute.api.BaseAPI for compute APIs to use

    Fixes bug 960226 where compute.api.HostAPI called non-existent methods

    Regression was introduced here:
    https://review.openstack.org/#change,5252

    Added tests for HostAPI

    Change-Id: Id17927bc608ff638ea9b0b5509f0f0bb14503f85

Changed in nova:
status: In Progress → Fix Committed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (stable/essex)

Fix proposed to branch: stable/essex
Review: https://review.openstack.org/6429

Devin Carlen (devcamcar)
Changed in nova:
importance: Undecided → High
milestone: none → folsom-1
Thierry Carrez (ttx)
Changed in nova:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in nova:
milestone: folsom-1 → 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.