]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commit
Add default quota class into DB during migration
authorJay S. Bryant <jsbryant@us.ibm.com>
Sat, 16 Nov 2013 01:01:58 +0000 (19:01 -0600)
committerJay S. Bryant <jsbryant@us.ibm.com>
Wed, 20 Nov 2013 18:47:55 +0000 (12:47 -0600)
commit7d2641688454d9064b691e4aab4b5d8b14d75305
treeb2e2f3f48996137a203bc63441f2db7a3462f208
parent1099f09a2d22389b75377758f89a4f3365e69305
Add default quota class into DB during migration

For some time now use_default_quota_class has been the
default setting for Cinder.  Cinder, however, has not been putting
any defaults for the default quota class into the database.  This
resulted in any command that queried for the default quotas to cause
the message "Deprecated: Default quota for resource: <resource> is set
by the default quota flag: <quota flag>, it is now deprecated.  Please use
the default quota class for default quota."

This commit resolves this issue by setting the default value for volumes,
snapshots and gigabytes in the quota_class table at migration time if there
is not already a class_name of 'default' in the quota_classes table.

Unit tests are included with this commit.

Closes-bug 1233763
Change-Id: I457ed8a9b78492eda22e31dfc198b2ee051d3ece
cinder/db/sqlalchemy/migrate_repo/versions/021_add_default_quota_class.py [new file with mode: 0644]
cinder/tests/test_migrations.py
cinder/tests/test_quota.py