is_public should be checked when creating volume type

Bug #1479170 reported by Liyingjun
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Cinder
Fix Released
Undecided
Liyingjun

Bug Description

DBError will be raised if we specify a non boolean value for is_public when creating volume type.

$ curl -g -i -X POST http://192.168.70.11:8776/v2/a0a74317a58b479290492ebc96b5019d/types -H "User-Agent: python-cinderclient" -H "Content-Type: application/json" -H "Accept: application/json" -H "X-Auth-Token: d8fe2654b94f459282ad02c5671b8826" -d '{"volume_type": {"os-volume-type-access:is_public": "xxx", "name": "test6", "description": "test6"}}'

Part of log from cinder-api.log
DB exception wrapped.
2015-07-29 09:09:08.752 TRACE oslo_db.sqlalchemy.exc_filters Traceback (most recent call last):
2015-07-29 09:09:08.752 TRACE oslo_db.sqlalchemy.exc_filters File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 889, in _execute_context
2015-07-29 09:09:08.752 TRACE oslo_db.sqlalchemy.exc_filters context = constructor(dialect, self, conn, *args)
2015-07-29 09:09:08.752 TRACE oslo_db.sqlalchemy.exc_filters File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/default.py", line 573, in _init_compiled
2015-07-29 09:09:08.752 TRACE oslo_db.sqlalchemy.exc_filters param.append(processors[key](compiled_params[key]))
2015-07-29 09:09:08.752 TRACE oslo_db.sqlalchemy.exc_filters File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/processors.py", line 56, in boolean_to_int
2015-07-29 09:09:08.752 TRACE oslo_db.sqlalchemy.exc_filters return int(value)
2015-07-29 09:09:08.752 TRACE oslo_db.sqlalchemy.exc_filters ValueError: invalid literal for int() with base 10: 'xxx'

Full log: http://paste.openstack.org/show/406153/

Liyingjun (liyingjun)
Changed in cinder:
assignee: nobody → Liyingjun (liyingjun)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to cinder (master)

Fix proposed to branch: master
Review: https://review.openstack.org/206784

Changed in cinder:
status: New → In Progress
Changed in cinder:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in cinder:
milestone: none → liberty-3
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in cinder:
milestone: liberty-3 → 7.0.0
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.