Relax bucket creation schema
Apparently some AWS-supplied tools use undocumented root elements. Change-Id: I3d56f9560c2d96b08e6837d053fdff654c531062 Closes-Bug: #1611749
This commit is contained in:
parent
1d8d305b57
commit
0a2bfb8bae
@ -1,4 +1,4 @@
|
|||||||
start =
|
start =
|
||||||
element CreateBucketConfiguration {
|
element * {
|
||||||
element LocationConstraint { xsd:string }
|
element LocationConstraint { xsd:string }
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,8 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<grammar xmlns="http://relaxng.org/ns/structure/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
|
<grammar xmlns="http://relaxng.org/ns/structure/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
|
||||||
<start>
|
<start>
|
||||||
<element name="CreateBucketConfiguration">
|
<element>
|
||||||
|
<anyName/>
|
||||||
<element name="LocationConstraint">
|
<element name="LocationConstraint">
|
||||||
<data type="string"/>
|
<data type="string"/>
|
||||||
</element>
|
</element>
|
||||||
|
@ -363,9 +363,8 @@ class TestSwift3Bucket(Swift3TestCase):
|
|||||||
self.assertEqual(status.split()[0], '200')
|
self.assertEqual(status.split()[0], '200')
|
||||||
self.assertEqual(headers['Location'], '/bucket')
|
self.assertEqual(headers['Location'], '/bucket')
|
||||||
|
|
||||||
@s3acl
|
def _test_bucket_PUT_with_location(self, root_element):
|
||||||
def test_bucket_PUT_with_location(self):
|
elem = Element(root_element)
|
||||||
elem = Element('CreateBucketConfiguration')
|
|
||||||
SubElement(elem, 'LocationConstraint').text = 'US'
|
SubElement(elem, 'LocationConstraint').text = 'US'
|
||||||
xml = tostring(elem)
|
xml = tostring(elem)
|
||||||
|
|
||||||
@ -377,6 +376,20 @@ class TestSwift3Bucket(Swift3TestCase):
|
|||||||
status, headers, body = self.call_swift3(req)
|
status, headers, body = self.call_swift3(req)
|
||||||
self.assertEqual(status.split()[0], '200')
|
self.assertEqual(status.split()[0], '200')
|
||||||
|
|
||||||
|
@s3acl
|
||||||
|
def test_bucket_PUT_with_location(self):
|
||||||
|
self._test_bucket_PUT_with_location('CreateBucketConfiguration')
|
||||||
|
|
||||||
|
@s3acl
|
||||||
|
def test_bucket_PUT_with_ami_location(self):
|
||||||
|
# ec2-ami-tools apparently uses CreateBucketConstraint instead?
|
||||||
|
self._test_bucket_PUT_with_location('CreateBucketConstraint')
|
||||||
|
|
||||||
|
@s3acl
|
||||||
|
def test_bucket_PUT_with_strange_location(self):
|
||||||
|
# Even crazier: it doesn't seem to matter
|
||||||
|
self._test_bucket_PUT_with_location('foo')
|
||||||
|
|
||||||
def test_bucket_PUT_with_canned_acl(self):
|
def test_bucket_PUT_with_canned_acl(self):
|
||||||
req = Request.blank('/bucket',
|
req = Request.blank('/bucket',
|
||||||
environ={'REQUEST_METHOD': 'PUT'},
|
environ={'REQUEST_METHOD': 'PUT'},
|
||||||
|
Loading…
x
Reference in New Issue
Block a user