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