Merge lp:~swift/swift/swift_xml_subdir_changes into lp:~hudson-openstack/swift/trunk

Proposed by Conrad Weidenkeller
Status: Merged
Approved by: gholt
Approved revision: 295
Merged at revision: 296
Proposed branch: lp:~swift/swift/swift_xml_subdir_changes
Merge into: lp:~hudson-openstack/swift/trunk
Diff against target: 29 lines (+5/-3)
2 files modified
swift/container/server.py (+2/-1)
test/unit/container/test_server.py (+3/-2)
To merge this branch: bzr merge lp:~swift/swift/swift_xml_subdir_changes
Reviewer Review Type Date Requested Status
gholt (community) Needs Fixing
Mike Barton Pending
Review via email: mp+60871@code.launchpad.net

Commit message

Change subdir nodes in XML formatted object listings to align with object nodes. Now: <subdir name="foo"><name>foo</name></subdir> Before: <subdir name="foo" />

Description of the change

Change subdir nodes in XML to align with object nodes. Example:

Now

<subdir name="foo"><name>foo</name></subdir>

Before

<subdir name="foo" />

To post a comment you must log in.
Revision history for this message
gholt (gholt) wrote :

This isn't really part of your change, but it has bothered me for a while so maybe you won't mind patching it. The attribute name should be saxutils.quoteattr encoded and the body of the name node should be as it is, saxutils.escape encoded.

Revision history for this message
gholt (gholt) wrote :

Might want to have Mike look at this too, since I think the attribute instead of body name was because he wanted to put items within the subdir element later. Kind of like how the container element has a name attribute and not a subelement of name.

Revision history for this message
gholt (gholt) wrote :

Assuming this goes through, an entry in CHANGELOG is needed.

Revision history for this message
gholt (gholt) wrote :

Mike verbally mumbled his approval but apparently doesn't want to go on record.

review: Approve
Revision history for this message
OpenStack Infra (hudson-openstack) wrote :
Download full text (78.3 KiB)

The attempt to merge lp:~swift/swift/swift_xml_subdir_changes into lp:swift failed. Below is the output from the failed tests.

running test
running egg_info
creating swift.egg-info
writing swift.egg-info/PKG-INFO
writing top-level names to swift.egg-info/top_level.txt
writing dependency_links to swift.egg-info/dependency_links.txt
writing entry points to swift.egg-info/entry_points.txt
writing manifest file 'swift.egg-info/SOURCES.txt'
reading manifest file 'swift.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
warning: no files found matching 'ChangeLog'
writing manifest file 'swift.egg-info/SOURCES.txt'
running build_ext

UNABLE TO READ FUNCTIONAL TESTS CONFIG FILE
UNABLE TO READ FUNCTIONAL TESTS CONFIG FILE
SKIPPING FUNCTIONAL TESTS DUE TO NO CONFIG
testAccountHead (test.functional.tests.TestAccount) ... SKIP
testContainerListing (test.functional.tests.TestAccount) ... SKIP
testContainerSerializedInfo (test.functional.tests.TestAccount) ... SKIP
testContainersOrderedByName (test.functional.tests.TestAccount) ... SKIP
testInvalidAuthToken (test.functional.tests.TestAccount) ... SKIP
testInvalidPath (test.functional.tests.TestAccount) ... SKIP
testInvalidUTF8Path (test.functional.tests.TestAccount) ... SKIP
testLastContainerMarker (test.functional.tests.TestAccount) ... SKIP
testListingLimit (test.functional.tests.TestAccount) ... SKIP
testMarkerLimitContainerList (test.functional.tests.TestAccount) ... SKIP
testNoAuthToken (test.functional.tests.TestAccount) ... SKIP
testPUT (test.functional.tests.TestAccount) ... SKIP
testVersionOnlyPath (test.functional.tests.TestAccount) ... SKIP
testGetRequest (test.functional.tests.TestAccountNoContainers) ... SKIP
testGetRequest (test.functional.tests.TestAccountNoContainersUTF8) ... SKIP
testAccountHead (test.functional.tests.TestAccountUTF8) ... SKIP
testContainerListing (test.functional.tests.TestAccountUTF8) ... SKIP
testContainerSerializedInfo (test.functional.tests.TestAccountUTF8) ... SKIP
testContainersOrderedByName (test.functional.tests.TestAccountUTF8) ... SKIP
testInvalidAuthToken (test.functional.tests.TestAccountUTF8) ... SKIP
testInvalidPath (test.functional.tests.TestAccountUTF8) ... SKIP
testInvalidUTF8Path (test.functional.tests.TestAccountUTF8) ... SKIP
testLastContainerMarker (test.functional.tests.TestAccountUTF8) ... SKIP
testListingLimit (test.functional.tests.TestAccountUTF8) ... SKIP
testMarkerLimitContainerList (test.functional.tests.TestAccountUTF8) ... SKIP
testNoAuthToken (test.functional.tests.TestAccountUTF8) ... SKIP
testPUT (test.functional.tests.TestAccountUTF8) ... SKIP
testVersionOnlyPath (test.functional.tests.TestAccountUTF8) ... SKIP
testContainerExistenceCachingProblem (test.functional.tests.TestContainer) ... SKIP
testContainerFileList (test.functional.tests.TestContainer) ... SKIP
testContainerFileListOnContainerThatDoesNotExist (test.functional.tests.TestContainer) ... SKIP
testContainerFileListWithLimit (test.functional.tests.TestContainer) ... SKIP
testContainerInfo (test.functional.tests.TestContainer) ... SKIP
testContainerInfoOnContainerThatDoesNotExist (test.functional.tests.TestContainer) ... SKIP
testContainerNameLimit (test.functional....

Revision history for this message
gholt (gholt) wrote :

Okay, this needs unit test updates.

Also, just for future reference, you should push to lp:~ohm/swift/<branchname> and not lp:~swift

review: Needs Fixing
Revision history for this message
Conrad Weidenkeller (cweidenkeller) wrote :

Functional and Unit tests pass now. Did you want me to push changes to my LP account or just keep this branch going till merge?

root@saio:~/swift/trunk# ./.unittests
..........................................SSSSSSSS................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................
----------------------------------------------------------------------
Ran 818 tests in 36.885s

OK (SKIP=8)

root@saio:~/swift/trunk# ./.functests
.............................................................................................................................................
----------------------------------------------------------------------
Ran 141 tests in 140.064s

OK
................
----------------------------------------------------------------------
Ran 16 tests in 8.328s

OK

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'swift/container/server.py'
2--- swift/container/server.py 2011-05-09 20:21:34 +0000
3+++ swift/container/server.py 2011-05-19 10:46:41 +0000
4@@ -316,7 +316,8 @@
5 created_at = datetime.utcfromtimestamp(
6 float(created_at)).isoformat()
7 if content_type is None:
8- xml_output.append('<subdir name="%s" />' % name)
9+ xml_output.append('<subdir name="%s"><name>%s</name>'
10+ '</subdir>' % (name, name))
11 else:
12 content_type = saxutils.escape(content_type)
13 xml_output.append('<object><name>%s</name><hash>%s</hash>'\
14
15=== modified file 'test/unit/container/test_server.py'
16--- test/unit/container/test_server.py 2011-01-25 01:12:38 +0000
17+++ test/unit/container/test_server.py 2011-05-19 10:46:41 +0000
18@@ -732,8 +732,9 @@
19 environ={'REQUEST_METHOD': 'GET'})
20 resp = self.controller.GET(req)
21 self.assertEquals(resp.body, '<?xml version="1.0" encoding="UTF-8"?>'
22- '\n<container name="c"><subdir name="US-OK-" />'
23- '<subdir name="US-TX-" /><subdir name="US-UT-" /></container>')
24+ '\n<container name="c"><subdir name="US-OK-"><name>US-OK-</name></subdir>'
25+ '<subdir name="US-TX-"><name>US-TX-</name></subdir>'
26+ '<subdir name="US-UT-"><name>US-UT-</name></subdir></container>')
27
28 def test_GET_path(self):
29 req = Request.blank('/sda1/p/a/c', environ={'REQUEST_METHOD': 'PUT',