Bug fix.
authorAntony Chazapis <chazapis@gmail.com>
Tue, 5 Jul 2011 17:46:49 +0000 (20:46 +0300)
committerAntony Chazapis <chazapis@gmail.com>
Tue, 5 Jul 2011 17:46:49 +0000 (20:46 +0300)
docs/source/devguide.rst
pithos/api/functions.py

index 80537ec..6d3625d 100644 (file)
@@ -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
 ===========================  ==============================
 
 
index 71f366a..459d54d 100644 (file)
@@ -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':