flavors create yields 400 due to id() typo

Bug #938212 reported by Anthony Young
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
High
Anthony Young

Bug Description

Steps to reproduce:

> nova flavor-create anotherflavor 45 256 2 1 --ephemeral 33

Expected:

Successful creation

Actual:

The flavor is created, but a 400 is returned. nova-api shows this:

(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 767, in post_process_extensions
(nova.api.openstack.wsgi): TRACE: **action_args)
(nova.api.openstack.wsgi): TRACE: File "/opt/stack/nova/nova/api/openstack/compute/contrib/flavorextradata.py", line 88, in create
(nova.api.openstack.wsgi): TRACE: get_instance_type_by_flavor_id(id)
(nova.api.openstack.wsgi): TRACE: File "/opt/stack/nova/nova/compute/instance_types.py", line 136, in get_instance_type_by_flavor_id
(nova.api.openstack.wsgi): TRACE: return db.instance_type_get_by_flavor_id(ctxt, flavorid)
(nova.api.openstack.wsgi): TRACE: File "/opt/stack/nova/nova/db/api.py", line 1445, in instance_type_get_by_flavor_id
(nova.api.openstack.wsgi): TRACE: return IMPL.instance_type_get_by_flavor_id(context, id)
(nova.api.openstack.wsgi): TRACE: File "/opt/stack/nova/nova/db/sqlalchemy/api.py", line 119, 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 3481, in instance_type_get_by_flavor_id
(nova.api.openstack.wsgi): TRACE: filter_by(flavorid=flavor_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)

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/4370

Brian Waldon (bcwaldon)
Changed in nova:
importance: Undecided → High
milestone: none → essex-4
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

Reviewed: https://review.openstack.org/4370
Committed: http://github.com/openstack/nova/commit/1fe09926c8c1523d83aa834d2b143d266fde14ad
Submitter: Jenkins
Branch: master

commit 1fe09926c8c1523d83aa834d2b143d266fde14ad
Author: Anthony Young <email address hidden>
Date: Tue Feb 21 13:59:29 2012 -0800

    Fix error that causes 400 in flavor create.

     * Fixes bug 938212
     * Fix style per bcwaldon's comment

    Change-Id: I5c4a024c29634f1b786a36ca93050b9f2de41dea

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-4 → 2012.1
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.