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"))
Fix proposed to branch: master /review. openstack. org/5499
Review: https:/