summaryrefslogtreecommitdiffstats
path: root/ufo/gluster/swift/common/constraints.py
diff options
context:
space:
mode:
Diffstat (limited to 'ufo/gluster/swift/common/constraints.py')
-rw-r--r--ufo/gluster/swift/common/constraints.py15
1 files changed, 10 insertions, 5 deletions
diff --git a/ufo/gluster/swift/common/constraints.py b/ufo/gluster/swift/common/constraints.py
index dd8662a9..11f626bb 100644
--- a/ufo/gluster/swift/common/constraints.py
+++ b/ufo/gluster/swift/common/constraints.py
@@ -13,15 +13,20 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-from webob.exc import HTTPBadRequest
-
+try:
+ from webob.exc import HTTPBadRequest
+except ImportError:
+ from swift.common.swob import HTTPBadRequest
import swift.common.constraints
import swift.common.ring as _ring
from gluster.swift.common import Glusterfs, ring
-
-MAX_OBJECT_NAME_COMPONENT_LENGTH = swift.common.constraints.constraints_conf_int(
- 'max_object_name_component_length', 255)
+if hasattr(swift.common.constraints, 'constraints_conf_int'):
+ MAX_OBJECT_NAME_COMPONENT_LENGTH = \
+ swift.common.constraints.constraints_conf_int(
+ 'max_object_name_component_length', 255)
+else:
+ MAX_OBJECT_NAME_COMPONENT_LENGTH = 255
def validate_obj_name_component(obj):
if len(obj) > MAX_OBJECT_NAME_COMPONENT_LENGTH: