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
Remove double GET on range requests.

The proxy server's ObjectController was performing multiple GET
requests to the object server when processing requests with Range
headers. This was a workaround for a bug in the proxy server's
Controller.GETorHEAD_base method where a response code of 416 from the
object server was incorrectly treated as a bad response from the
backend, the same way a 404 or a 5xx would be.

A 416 (Requested Range Not Satisfiable) from the object server is now
considered a good response. Since the response headers from the object
server already include the X-Object-Manifest header, there's no need
to make a second request (sans Range header) to see if the object is a
manifest.

Bonus fix: updated message for status 416 to match RFC2616.

Bonus fix 2: removed a leftover debugging print() in
test/unit/proxy/test_server.py.

Fixes bug 1065869.

Change-Id: I156af0b463f02ef19a8cfe37092544a599d89b78
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"
Allow unsetting of X-Container-Sync-To header.

Fixes bug 1071790.

Change-Id: Ic0509190b9994e7d983bcf20daa64a650cc974cb
Extended documentation for using custom loggers

Change-Id: I78a5c109c9440df752e390698502f57d4392fb67
Merge "Extended documentation for using custom loggers"
Merge "Remove double GET on range requests."
Fix non standard 100-continue behaviour

Swift proxy server, when communicating with
the back-end servers ALWAYS sends 100-continue.
Even if the length headers indicate that there
is no body (content-length: 0).
This behavior is not inline with the standard.
RFC2616:8.2.3 disallows 100-continue
        for req.content_length==0

This fix removes 100-continue during PUT requests
without a body while maintining the ability for
handoff in case of faliure.

On branch bp/wsgi-application-interface-5
   modified:   swift/proxy/controllers/obj.py

Fixes: Bug #1070025
Implements Blueprint:  	wsgi-application-interface

Change-Id: Ia4eb8b886a74968cca4e8bde208641b37f2c104c
changed TRUE_VALUES references to utils.config_true_value() call

cleaned up pep8 (v1.3.3) in all files this patch touches

Change-Id: I30e8314dfdc23fb70ab83741a548db9905dfccff
Fixed bugs re: make_pre_authed* and SCRIPT_NAME

There were bugs with SCRIPT_NAME and
swift.common.wsgi.make_pre_authed* functions.

1) SCRIPT_NAME wasn't copied with PATH_INFO, which it should've been.
2) When a new path was given, SCRIPT_NAME wasn't set to an empty
   string but just omitted, which is allowed by spec, but really
   should be set.

For completeness, if SCRIPT_NAME doesn't exist in the source env, it
will be created in the new env, but as an empty string.

Change-Id: Ifbc27ed8ff357038c54df4d37de46cfd5e31372e
Merge "changed TRUE_VALUES references to utils.config_true_value() call"