From: Antony Chazapis Date: Tue, 5 Jul 2011 17:46:49 +0000 (+0300) Subject: Bug fix. X-Git-Tag: pithos/v0.7.8~229 X-Git-Url: https://code.grnet.gr/git/pithos/commitdiff_plain/038f1ae9f56b7822f8f08998f4dc488d581f766b Bug fix. --- diff --git a/docs/source/devguide.rst b/docs/source/devguide.rst index 80537ec..6d3625d 100644 --- a/docs/source/devguide.rst +++ b/docs/source/devguide.rst @@ -618,7 +618,6 @@ Return Code Description 409 (Conflict) The object can not be created from the provided hashmap, or there are conflicting permissions (a list of missing hashes, or a conflicting sharing path will be included in the reply - in JSON format) 411 (Length Required) Missing ``Content-Length`` or ``Content-Type`` in the request 422 (Unprocessable Entity) The MD5 checksum of the data written to the storage system does not match the (optionally) supplied ETag value -409 (Conflict) Conflict with the current state of the resource =========================== ============================== diff --git a/pithos/api/functions.py b/pithos/api/functions.py index 71f366a..459d54d 100644 --- a/pithos/api/functions.py +++ b/pithos/api/functions.py @@ -215,13 +215,14 @@ def container_list(request, v_account): try: meta = backend.get_container_meta(request.user, v_account, x[0], until) policy = backend.get_container_policy(request.user, v_account, x[0]) - for k, v in policy.iteritems(): - meta['X-Container-Policy-' + k] = v - container_meta.append(printable_header_dict(meta)) except NotAllowedError: raise Unauthorized('Access denied') except NameError: pass + else: + for k, v in policy.iteritems(): + meta['X-Container-Policy-' + k] = v + container_meta.append(printable_header_dict(meta)) if request.serialization == 'xml': data = render_to_string('containers.xml', {'account': v_account, 'containers': container_meta}) elif request.serialization == 'json': @@ -420,9 +421,10 @@ def object_list(request, v_account, v_container): raise Unauthorized('Access denied') except NameError: pass - update_sharing_meta(permissions, v_account, v_container, x[0], meta) - update_public_meta(public, meta) - object_meta.append(printable_header_dict(meta)) + else: + update_sharing_meta(permissions, v_account, v_container, x[0], meta) + update_public_meta(public, meta) + object_meta.append(printable_header_dict(meta)) if request.serialization == 'xml': data = render_to_string('objects.xml', {'container': v_container, 'objects': object_meta}) elif request.serialization == 'json':