Fix set ACL fails to existing bucket
ACL API should be called against to an existing bucket. However current swift3 returns 409 Bucket Already Exists when the target bucket has already existed. We should make it to return 200 OK when we can put the ACL successfully. Change-Id: I1de6379cbe1fd3eeb7bbcb52a3cf72c5821dfede
This commit is contained in:
		@@ -187,7 +187,7 @@ class AclController(Controller):
 | 
			
		||||
                for header, acl in translated_acl:
 | 
			
		||||
                    req.headers[header] = acl
 | 
			
		||||
 | 
			
		||||
            resp = req.get_response(self.app)
 | 
			
		||||
            resp = req.get_response(self.app, 'POST')
 | 
			
		||||
            resp.status = HTTP_OK
 | 
			
		||||
            resp.headers.update({'Location': req.container_name})
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -15,7 +15,7 @@
 | 
			
		||||
 | 
			
		||||
import unittest
 | 
			
		||||
 | 
			
		||||
from swift.common.swob import Request
 | 
			
		||||
from swift.common.swob import Request, HTTPAccepted
 | 
			
		||||
 | 
			
		||||
from swift3.test.unit import Swift3TestCase
 | 
			
		||||
from swift3.etree import fromstring, tostring, Element, SubElement
 | 
			
		||||
@@ -28,6 +28,9 @@ class TestSwift3Acl(Swift3TestCase):
 | 
			
		||||
 | 
			
		||||
    def setUp(self):
 | 
			
		||||
        super(TestSwift3Acl, self).setUp()
 | 
			
		||||
        # All ACL API should be called against to existing bucket.
 | 
			
		||||
        self.swift.register('PUT', '/v1/AUTH_test/bucket',
 | 
			
		||||
                            HTTPAccepted, {}, None)
 | 
			
		||||
 | 
			
		||||
    def _check_acl(self, owner, body):
 | 
			
		||||
        elem = fromstring(body, 'AccessControlPolicy')
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user