command "nova diagnostics" fails due to typo

Bug #957716 reported by Anthony Young
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
High
Anthony Young

Bug Description

To reproduce:

$ nova diagnostics [server_id]

Expected:

Nifty diagnostic info.

Actual:

ERROR: The server could not comply with the request since it is either malformed or otherwise incorrect. (HTTP 400)
2012-03-16 23:27:59 ERROR nova.api.openstack.wsgi [req-61268e94-139c-4b81-88e5-e2addcc6803e b399a42284c4438db639d41fc2530baa c4ab6c17bc4742298838bd9c6fbc41e1] Exception handling resource: id() takes exactly one argument (0 given)(nova.api.openstack.wsgi): TRACE: Traceback (most recent call last):(nova.api.openstack.wsgi): TRACE: File "/opt/stack/nova/nova/api/openstack/wsgi.py", line 851, in _process_stack(nova.api.openstack.wsgi): TRACE: action_result = self.dispatch(meth, request, action_args)(nova.api.openstack.wsgi): TRACE: File "/opt/stack/nova/nova/api/openstack/wsgi.py", line 926, in dispatch(nova.api.openstack.wsgi): TRACE: return method(req=request, **action_args)(nova.api.openstack.wsgi): TRACE: File "/opt/stack/nova/nova/api/openstack/compute/contrib/server_diagnostics.py", line 45, in index(nova.api.openstack.wsgi): TRACE: instance = compute_api.get(context, id)(nova.api.openstack.wsgi): TRACE: File "/opt/stack/nova/nova/compute/api.py", line 1022, in get(nova.api.openstack.wsgi): TRACE: instance = self.db.instance_get(context, instance_id)(nova.api.openstack.wsgi): TRACE: File "/opt/stack/nova/nova/db/api.py", line 554, in instance_get(nova.api.openstack.wsgi): TRACE: return IMPL.instance_get(context, instance_id)(nova.api.openstack.wsgi): TRACE: File "/opt/stack/nova/nova/db/sqlalchemy/api.py", line 120, in wrapper(nova.api.openstack.wsgi): TRACE: return f(*args, **kwargs)(nova.api.openstack.wsgi): TRACE: File "/opt/stack/nova/nova/db/sqlalchemy/api.py", line 1353, in instance_get(nova.api.openstack.wsgi): TRACE: filter_by(id=instance_id).\(nova.api.openstack.wsgi): TRACE: File "/usr/lib/python2.7/dist-packages/sqlalchemy/orm/query.py", line 1652, in first(nova.api.openstack.wsgi): TRACE: ret = list(self[0:1])(nova.api.openstack.wsgi): TRACE: File "/usr/lib/python2.7/dist-packages/sqlalchemy/orm/query.py", line 1560, in __getitem__(nova.api.openstack.wsgi): TRACE: return list(res)(nova.api.openstack.wsgi): TRACE: File "/usr/lib/python2.7/dist-packages/sqlalchemy/orm/query.py", line 1721, in __iter__(nova.api.openstack.wsgi): TRACE: return self._execute_and_instances(context)(nova.api.openstack.wsgi): TRACE: File "/usr/lib/python2.7/dist-packages/sqlalchemy/orm/query.py", line 1726, in _execute_and_instances(nova.api.openstack.wsgi): TRACE: mapper=self._mapper_zero_or_none())(nova.api.openstack.wsgi): TRACE: File "/usr/lib/python2.7/dist-packages/sqlalchemy/orm/session.py", line 724, in execute(nova.api.openstack.wsgi): TRACE: clause, params or {})(nova.api.openstack.wsgi): TRACE: File "/usr/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 1191, in execute(nova.api.openstack.wsgi): TRACE: params)(nova.api.openstack.wsgi): TRACE: File "/usr/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 1269, in _execute_clauseelement(nova.api.openstack.wsgi): TRACE: parameters=params(nova.api.openstack.wsgi): TRACE: File "/usr/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 1377, in __create_execution_context(nova.api.openstack.wsgi): TRACE: connection=self, **kwargs)(nova.api.openstack.wsgi): TRACE: File "/usr/lib/python2.7/dist-packages/sqlalchemy/engine/default.py", line 388, in __init__(nova.api.openstack.wsgi): TRACE: grp,m in enumerate(parameters)](nova.api.openstack.wsgi): TRACE: File "/usr/lib/python2.7/dist-packages/sqlalchemy/sql/compiler.py", line 291, in construct_params(nova.api.openstack.wsgi): TRACE: pd[self.bind_names[bindparam]] = bindparam.value()(nova.api.openstack.wsgi): TRACE: TypeError: id() takes exactly one argument (0 given)(nova.api.openstack.wsgi): TRACE:

Fixing the related typo causes the server to raise a NotImplemented error - I guess this enticing command is not supported in libvirt :(

--- a/nova/api/openstack/compute/contrib/server_diagnostics.py
+++ b/nova/api/openstack/compute/contrib/server_diagnostics.py
@@ -42,7 +42,7 @@ class ServerDiagnosticsController(object):
         authorize(context)
         compute_api = compute.API()
         try:
- instance = compute_api.get(context, id)
+ instance = compute_api.get(context, server_id)
         except exception.NotFound():
             raise webob.exc.HTTPNotFound(_("Instance not found"))

summary: - command "nova diagnostics" fails due to typo in
+ command "nova diagnostics" fails due to typo
description: updated
Yaguang Tang (heut2008)
Changed in nova:
status: New → Confirmed
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/5499

Changed in nova:
assignee: nobody → Anthony Young (sleepsonthefloor)
status: Confirmed → In Progress
Changed in nova:
milestone: none → essex-rc1
importance: Undecided → High
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

Reviewed: https://review.openstack.org/5499
Committed: http://github.com/openstack/nova/commit/74aa84b0ec5bf406b7cf324bef0267da4e653823
Submitter: Jenkins
Branch: master

commit 74aa84b0ec5bf406b7cf324bef0267da4e653823
Author: Anthony Young <email address hidden>
Date: Sun Mar 18 22:44:59 2012 -0700

    Fix typo in server diagnostics extension.

     * Fixes bug 957716
     * Tweak test to catch regression

    Change-Id: I71cafadfec90d907a65429e1c1ca1812d1069b25

Changed in nova:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in nova:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in nova:
milestone: essex-rc1 → 2012.1
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.