]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commitdiff
Deprecate config-based Quota Driver
authorSalvatore Orlando <salv.orlando@gmail.com>
Fri, 1 May 2015 23:32:23 +0000 (16:32 -0700)
committerSalvatore Orlando <salv.orlando@gmail.com>
Fri, 1 May 2015 23:32:23 +0000 (16:32 -0700)
This patch displays a deprecation warning everytime the quota
driver neutron.quota.ConfDriver is loaded.
The driver will be removed in the "M" cycle.

Change-Id: Ifb799755bce50bb089f8df020286fd2e95c80a68
Closes-Bug: #1430523

neutron/quota.py

index 3cf8e11d944c35a74fbf7d4e3cf214deefc0b4e9..95e398aed18b9a9042874a6c32c1c59897e0b360 100644 (file)
@@ -23,6 +23,8 @@ import webob
 
 from neutron.common import exceptions
 from neutron.i18n import _LI, _LW
+from neutron.openstack.common import versionutils
+
 
 LOG = logging.getLogger(__name__)
 QUOTA_DB_MODULE = 'neutron.db.quota_db'
@@ -216,6 +218,12 @@ class QuotaEngine(object):
                              "loaded plugin does not support 'quotas' table."))
             if isinstance(_driver_class, basestring):
                 _driver_class = importutils.import_object(_driver_class)
+            if isinstance(_driver_class, ConfDriver):
+                versionutils.report_deprecated_feature(
+                    LOG, _LW("The quota driver neutron.quota.ConfDriver is "
+                             "deprecated as of Liberty. "
+                             "neutron.db.quota_db.DbQuotaDriver should be "
+                             "used in its place"))
             self._driver = _driver_class
             LOG.info(_LI('Loaded quota_driver: %s.'), _driver_class)
         return self._driver