Commit c0a83a65 authored by Antony Chazapis's avatar Antony Chazapis
Browse files

Update default settings. Minor changes.

parent 7335a6c5
......@@ -7,10 +7,7 @@ from django.template.loader import render_to_string
from django.utils import simplejson as json
from django.utils.http import http_date, parse_etags
try:
from django.utils.http import parse_http_date_safe
except:
from pithos.api.compat import parse_http_date_safe
from pithos.api.compat import parse_http_date_safe
from pithos.api.faults import Fault, NotModified, BadRequest, Unauthorized, ItemNotFound, Conflict, LengthRequired, PreconditionFailed, RangeNotSatisfiable, UnprocessableEntity
from pithos.api.util import get_meta, get_range, api_method
......
......@@ -15,6 +15,8 @@ from pithos.api.faults import Fault, BadRequest, ServiceUnavailable
import datetime
import logging
logger = logging.getLogger(__name__)
def format_meta_key(k):
"""
Convert underscores to dashes and capitalize intra-dash strings.
......@@ -142,7 +144,7 @@ def api_method(http_method = None, format_allowed = False):
except Fault, fault:
return render_fault(request, fault)
except BaseException, e:
logging.exception('Unexpected error: %s' % e)
logger.exception('Unexpected error: %s' % e)
fault = ServiceUnavailable('Unexpected error')
return render_fault(request, fault)
return wrapper
......
......@@ -138,10 +138,7 @@ class BackEnd(basebackend.BaseBackEnd):
if not os.path.exists(fullname):
raise NameError('Container does not exist')
while prefix.startswith('/'):
prefix = prefix[1:]
# TODO: Test this with various prefixes. Does '//' bother it?
prefix = os.path.join(account, container, prefix)
prefix = os.path.join(account, container, prefix.lstrip('/'))
c = self.con.execute('select * from objects where name like ''?'' order by name', (os.path.join(prefix, '%'),))
objects = [x[0][len(prefix):] for x in c.fetchall()]
if delimiter:
......
......@@ -75,7 +75,7 @@ SECRET_KEY = '$j0cdrfm*0sc2j+e@@2f-&3-_@2=^!z#+b-8o4_i10@2%ev7si'
TEMPLATE_LOADERS = (
'django.template.loaders.filesystem.Loader',
'django.template.loaders.app_directories.Loader',
# 'django.template.loaders.eggs.Loader',
# 'django.template.loaders.eggs.Loader',
)
MIDDLEWARE_CLASSES = (
......@@ -84,6 +84,7 @@ MIDDLEWARE_CLASSES = (
# 'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'pithos.middleware.LoggingConfigMiddleware'
)
ROOT_URLCONF = 'pithos.urls'
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment