Patch https://review.openstack.org/278354 created a circular import when
added an "import cinder.db" line to cinder/api/common.py since
cinder/db/api.py imports cinder.api.common back, which breaks genconfig.
Change-Id: Ic60866822e74687101a3885f6000f89d901bb17a
Closes-Bug: #
1556889
from cinder.api.openstack import wsgi
from cinder.api import xmlutil
-import cinder.db
+from cinder.common import constants
from cinder import exception
from cinder.i18n import _
import cinder.policy
def _get_offset_param(params):
"""Extract offset id from request's dictionary (defaults to 0) or fail."""
offset = params.pop('offset', 0)
- return utils.validate_integer(offset, 'offset', 0, cinder.db.MAX_INT)
+ return utils.validate_integer(offset, 'offset', 0, constants.DB_MAX_INT)
def limited(items, request, max_limit=None):
--- /dev/null
+# Copyright 2016 Red Hat, Inc.
+# All Rights Reserved.
+#
+# Licensed under the Apache License, Version 2.0 (the "License"); you may
+# not use this file except in compliance with the License. You may obtain
+# a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+# License for the specific language governing permissions and limitations
+# under the License.
+
+
+# The maximum value a signed INT type may have
+DB_MAX_INT = 0x7FFFFFFF
from oslo_db import options as db_options
from cinder.api import common
+from cinder.common import constants
from cinder.i18n import _
db_opts = [
IMPL = db_concurrency.TpoolDbapiWrapper(CONF, _BACKEND_MAPPING)
# The maximum value a signed INT type may have
-MAX_INT = 0x7FFFFFFF
+MAX_INT = constants.DB_MAX_INT
###################