When using sqlalchemy as control plane, (in my case, i'm using sqlite), if user give the queue body with {}, then zaqar will raise below exception. That because line https://github.com/openstack/zaqar/blob/master/zaqar/storage/pooling.py#L190 will return {} as the flavor name instead of None.
2015-11-20 09:18:13.234 31466 ERROR zaqar.transport.wsgi.v2_0.queues [(None,) 888cbb7064144ae0bce0839165043b01 4a762062f9634145bce08352afb79429 - - -] [project_id:4a762062f9634145bce08352afb79429] (pysqlite2.dbapi2.InterfaceError) Error binding parameter 0 - probably unsupported type. [SQL: u'SELECT "Flavors".name, "Flavors".project, "Flavors".pool, "Flavors".capabilities \nFROM "Flavors" \nWHERE "Flavors".name = ? AND "Flavors".project = ?'] [parameters: ({}, u'4a762062f9634145bce08352afb79429')]
2015-11-20 09:18:13.234 31466 ERROR zaqar.transport.wsgi.v2_0.queues Traceback (most recent call last):
2015-11-20 09:18:13.234 31466 ERROR zaqar.transport.wsgi.v2_0.queues File "/home/feilong/MyWorkspace/workspace_community/zaqar/zaqar/transport/wsgi/v2_0/queues.py", line 79, in on_put
2015-11-20 09:18:13.234 31466 ERROR zaqar.transport.wsgi.v2_0.queues project=project_id)
2015-11-20 09:18:13.234 31466 ERROR zaqar.transport.wsgi.v2_0.queues File "/home/feilong/MyWorkspace/workspace_community/zaqar/zaqar/common/pipeline.py", line 97, in consumer
2015-11-20 09:18:13.234 31466 ERROR zaqar.transport.wsgi.v2_0.queues tmp = target(*args, **kwargs)
2015-11-20 09:18:13.234 31466 ERROR zaqar.transport.wsgi.v2_0.queues File "/home/feilong/MyWorkspace/workspace_community/zaqar/zaqar/storage/base.py", line 370, in create
2015-11-20 09:18:13.234 31466 ERROR zaqar.transport.wsgi.v2_0.queues return self._create(name, metadata, project)
2015-11-20 09:18:13.234 31466 ERROR zaqar.transport.wsgi.v2_0.queues File "/home/feilong/MyWorkspace/workspace_community/zaqar/zaqar/storage/pooling.py", line 193, in _create
2015-11-20 09:18:13.234 31466 ERROR zaqar.transport.wsgi.v2_0.queues self._pool_catalog.register(name, project=project, flavor=flavor)
2015-11-20 09:18:13.234 31466 ERROR zaqar.transport.wsgi.v2_0.queues File "/home/feilong/MyWorkspace/workspace_community/zaqar/zaqar/storage/pooling.py", line 492, in register
2015-11-20 09:18:13.234 31466 ERROR zaqar.transport.wsgi.v2_0.queues flavor = self._flavor_ctrl.get(flavor, project=project)
2015-11-20 09:18:13.234 31466 ERROR zaqar.transport.wsgi.v2_0.queues File "/home/feilong/MyWorkspace/workspace_community/zaqar/zaqar/storage/sqlalchemy/utils.py", line 44, in wrapper
2015-11-20 09:18:13.234 31466 ERROR zaqar.transport.wsgi.v2_0.queues return func(*args, **kwargs)
2015-11-20 09:18:13.234 31466 ERROR zaqar.transport.wsgi.v2_0.queues File "/home/feilong/MyWorkspace/workspace_community/zaqar/zaqar/storage/sqlalchemy/flavors.py", line 68, in get
2015-11-20 09:18:13.234 31466 ERROR zaqar.transport.wsgi.v2_0.queues flavor = self.driver.connection.execute(stmt).fetchone()
2015-11-20 09:18:13.234 31466 ERROR zaqar.transport.wsgi.v2_0.queues File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 914, in execute
2015-11-20 09:18:13.234 31466 ERROR zaqar.transport.wsgi.v2_0.queues return meth(self, multiparams, params)
2015-11-20 09:18:13.234 31466 ERROR zaqar.transport.wsgi.v2_0.queues File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/sql/elements.py", line 323, in _execute_on_connection
2015-11-20 09:18:13.234 31466 ERROR zaqar.transport.wsgi.v2_0.queues return connection._execute_clauseelement(self, multiparams, params)
2015-11-20 09:18:13.234 31466 ERROR zaqar.transport.wsgi.v2_0.queues File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 1010, in _execute_clauseelement
2015-11-20 09:18:13.234 31466 ERROR zaqar.transport.wsgi.v2_0.queues compiled_sql, distilled_params
2015-11-20 09:18:13.234 31466 ERROR zaqar.transport.wsgi.v2_0.queues File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 1146, in _execute_context
2015-11-20 09:18:13.234 31466 ERROR zaqar.transport.wsgi.v2_0.queues context)
2015-11-20 09:18:13.234 31466 ERROR zaqar.transport.wsgi.v2_0.queues File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 1341, in _handle_dbapi_exception
2015-11-20 09:18:13.234 31466 ERROR zaqar.transport.wsgi.v2_0.queues exc_info
2015-11-20 09:18:13.234 31466 ERROR zaqar.transport.wsgi.v2_0.queues File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/util/compat.py", line 199, in raise_from_cause
2015-11-20 09:18:13.234 31466 ERROR zaqar.transport.wsgi.v2_0.queues reraise(type(exception), exception, tb=exc_tb)
2015-11-20 09:18:13.234 31466 ERROR zaqar.transport.wsgi.v2_0.queues File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 1139, in _execute_context
2015-11-20 09:18:13.234 31466 ERROR zaqar.transport.wsgi.v2_0.queues context)
2015-11-20 09:18:13.234 31466 ERROR zaqar.transport.wsgi.v2_0.queues File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/default.py", line 450, in do_execute
2015-11-20 09:18:13.234 31466 ERROR zaqar.transport.wsgi.v2_0.queues cursor.execute(statement, parameters)
2015-11-20 09:18:13.234 31466 ERROR zaqar.transport.wsgi.v2_0.queues InterfaceError: (pysqlite2.dbapi2.InterfaceError) Error binding parameter 0 - probably unsupported type. [SQL: u'SELECT "Flavors".name, "Flavors".project, "Flavors".pool, "Flavors".capabilities \nFROM "Flavors" \nWHERE "Flavors".name = ? AND "Flavors".project = ?'] [parameters: ({}, u'4a762062f9634145bce08352afb79429')]
2015-11-20 09:18:13.234 31466 ERROR zaqar.transport.wsgi.v2_0.queues
Fix proposed to branch: master /review. openstack. org/247867
Review: https:/