Two MIME types sent during test

The directory tests TestContainerPathsEnv creates directorys during SetUp while indicating duplicate application internet media type (MIME) via the Content-Type header.

E.g the output on the line using 'nosetests -v test.functional.tests:TestContainerPaths.testContainerListing' includes:

Host: 127.0.0.1:8080
Accept-Encoding: identity
Content-Type: application/octet-stream
Content-Length: 0
content-type: application/directory
X-Auth-Token: AUTH_tkd40f5550289d4d60af75bb1b6c6067be

On branch bp/wsgi-application-interface-3
   modified:   test/functional/tests.py
Fixes: Bug #1068499
Implements Blueprint  	wsgi-application-interface

Change-Id: I49c5d1f73fff3c06d4be18b20c7209eff4e1326c
Track unlinks of async_pendings.

It's not sufficient to just look at swift.object-updater.successes to
see the async_pending unlink rate. There are two different spots where
unlinks happen: one when an async_pending has been successfully
processed, and another when the updater notices multiple
async_pendings for the same object. Both events are now tracked under
the same name: swift.object-updater.unlinks.

FakeLogger has now sprouted a couple of convenience methods for
testing logged metrics.

Fixed pep8 1.3.3's complaints in the files this diff touches.

Also: bonus speling and, grammar fixes in the admin guide.

Change-Id: I8c1493784adbe24ba2b5512615e87669b3d94505
Remove utf-8 in metadata and http header names

RFC2616 implicitly allows transferring utf-8 in
headers (vals) but not in header names (keys)

Swift functional tests includes testing for utf-8
header names (keys) which is non aligned with the standard.
This seem to be the case when testing file metadata.
File metadata keys are than transferred as part of
the http header keys (header names) as
      X-Object-Meta-<metadata_key>=metadata_name.

As a result metadata_keys in swift must be composed from
a subset of ASCII characters - alpha numerics,
some punctuation, not a lot else* and cannot be utf-8.

On branch bp/wsgi-application-interface-4
modified:   test/functional/tests.py

Change-Id: I1932e9d4ead83089e8a31a06d28a54f5625efb9c
Fixes: bug 1068026
Implements: blueprint wsgi-application-interface
Adding CORS support

Change-Id: I894473994cdfea0996ad16e7619aff421f604abc
Merge "Track unlinks of async_pendings."
Merge "Two MIME types sent during test"
Merge "Adding CORS support"
Merge "Remove utf-8 in metadata and http header names"
fix config parsing in swift-bench -x

This patch ensures that the command-line arg format (boolean)
doesn't conflict with the conf file format (string) and the
proper action is taken.

Change-Id: I3284096e1a9478897e1c3246ab190b46d2590243
Added partition option to swift-get-nodes

Sometimes you just want to know what machines a given partition
should be on, or what handoffs that partition would use if needed.
We've been meaning to add this option to swift-get-nodes for quite
some time, but I just finally got to it.

Example: swift-get-nodes /etc/swift/object.ring.gz -p 123

I tried to leave as much of the existing swift-get-nodes unaltered,
so the output isn't exactly distilled to just what you'd need for
getting a partition's nodes. But it should suffice for what it is, an
admin tool.

Change-Id: I438400ddc0eecbf9c48266e7f38a2e4f0765f374
Db reclamation should remove empty suffix dirs

When a db is reclaimed it removes the hash dir the db files are in,
but it does not try to remove the parent suffix dir though it might
be empty now. This eventually leads to a bunch of empty suffix dirs
lying around. This patch fixes that by attempting to remove the
parent suffix dir after a hash dir reclamation.

Here's a quick script to see how bad a given drive might be:

import os, os.path, sys
if len(sys.argv) != 2:
    sys.exit('%s <mount-point>' % sys.argv[0])
in_use = 0
empty = 0
containers = os.path.join(sys.argv[1], 'containers')
for p in os.listdir(containers):
    partition = os.path.join(containers, p)
    for s in os.listdir(partition):
        suffix = os.path.join(partition, s)
        if os.listdir(suffix):
            in_use += 1
        else:
            empty += 1
print in_use, 'in use,', empty, 'empty,', '%.02f%%' % (
    100.0 * empty / (in_use + empty)), 'empty'

And here's a quick script to clean up a drive:
NOTE THAT I HAVEN'T ACTUALLY RUN THIS ON A LIVE NODE YET!

import errno, os, os.path, sys
if len(sys.argv) != 2:
    sys.exit('%s <mount-point>' % sys.argv[0])
containers = os.path.join(sys.argv[1], 'containers')
for p in os.listdir(containers):
    partition = os.path.join(containers, p)
    for s in os.listdir(partition):
        suffix = os.path.join(partition, s)
        try:
            os.rmdir(suffix)
        except OSError, err:
            if err.errno not in (errno.ENOENT, errno.ENOTEMPTY):
                print err

Change-Id: I2e6463a4cd40597fc236ebe3e73b4b31347f2309
Merge "fix config parsing in swift-bench -x"
Merge "Db reclamation should remove empty suffix dirs"
Merge "Added partition option to swift-get-nodes"