diff --git a/swift3/controllers/acl.py b/swift3/controllers/acl.py index 10f09abb..8c8331cf 100644 --- a/swift3/controllers/acl.py +++ b/swift3/controllers/acl.py @@ -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}) diff --git a/swift3/test/unit/test_acl.py b/swift3/test/unit/test_acl.py index 49da870b..8ca77a4e 100644 --- a/swift3/test/unit/test_acl.py +++ b/swift3/test/unit/test_acl.py @@ -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')