Add an explicit unit test for handling content-length: 0

Change-Id: I3568d4dc1900e6ddb4860589ca6a7b7039cc8c2d
Signed-off-by: Peter Portante <peter.portante@redhat.com>
Container info memcache change broke ratelimiting.

Change-Id: I6379db52a75ed40080dd220f7fa72bcaffd0953c
Make it easier to debug badly broken tests.

If you manage to break a proxy server so badly that it can't even
return headers, then in test/unit/proxy/test_server.py,
readuntil2crlfs() will spin forever, killing your laptop battery and
providing zero help figuring out what's wrong.

This test-only change makes it so that, should readuntil2crlfs() run
out of data before getting its two CRLFs, it raises an exception that
tells you what it did manage to get, and does so in a finite amount of
time.

Change-Id: Ieacd18ce7f4d35a4960100d5fc3a0f910cb406ac
Improved autocreate testing

Increase testing coverage and make some of the test more accurate
(Some of the tests included too many responses from the account
servers that were not used by the test)

Change-Id: Ide2e0fcb89d5905e70d3111f7ac57b1cff23a99c
Fixes: Bug #1172152
Fix rebalance for zero weighted devices.

If we set device's weight to zero, currently balance will be set
special value(999.99) until zero weighted device return all
its partitions. So we cannot check balance has changed.
Thus we need to check balance or last_balance is special value.

Change-Id: I5b7db8b8e48db0c4771c51a764bda689869817d5
Fixes: bug #1171731
Add the max_clients parameter to bound clients

The new max_clients parameter allows one full control over the maximum
number of client requests that will be handled by a given worker for
any of the proxy, account, container or object servers.

Lowering the number of clients handled per worker, and raising the
number of workers can lessen the impact that a CPU intensive, or
blocking, request can have on other requests served by the same
worker.

If the maximum number of clients is set to one, then a given worker
will not perform another accept(2) call while processing, allowing
other workers a chance to process it.

DocImpact
Signed-off-by: Peter Portante <peter.portante@redhat.com>

Change-Id: Ic01430f7a6c5ff48d7aa349dc86a5f8ac463a420
Included time inside trans_id

Including the time inside the trans_id can be very useful for knowing
which logs to scan. I made this so the trans_id will still be the
same length (the randomness of the remaining uuid4 should be enough
for this use). I also added a convenience function for retreiving the
time information from a trans_id.

If you're wondering why I just didn't use uuid1 that embeds the time,
it's because it also embeds uuid.getnode() which "The first time this
runs, it may launch a separate program, which could be quite slow."
We could supply our own getnode value, but then we have to guarantee
its uniqueness, yada yada yada.

Change-Id: Ie33caf1e839fd1a21b01a928a8b301126bef7396
Merge "Make it easier to debug badly broken tests."
Merge "Improved autocreate testing"
Merge "Included time inside trans_id"
Merge "Add the max_clients parameter to bound clients"
conf.d support

Allow Swift daemons and servers to optionally accept a directory as the
configuration parameter.  Directory based configuration leverages
ConfigParser's native multi-file support.  Files ending in '.conf' in the
given directory are parsed in lexicographical order.  Filenames starting with
'.' are ignored.  A mixture of file and directory configuration paths is not
supported - if the configuration path is a file behavior is unchanged.

 * update swift-init to search for conf.d paths when building servers
    (e.g. /etc/swift/proxy-server.conf.d/)
 * new script swift-config can be used to inspect the cumulative configuration
 * pull a little bit of code out of run_wsgi and test separately
 * fix example config bug for the proxy servers client_disconnect option
 * added section on directory based configuration to deployment guide

DocImpact

Implements: blueprint confd
Change-Id: I89b0f48e538117f28590cf6698401f74ef58003b
Merge "Container info memcache change broke ratelimiting."
Uses None instead of mutable lists for function param defaults

Addressing bug 1174809, changes use of mutable lists as as default
arguments and defaults them within the function. Otherwise, those
defaults can be unexpectedly persisted with the function between
invocations and erupt into mass hysteria on the streets.

To my knowledge there aren't known cases of the current use causing
specific issues, but even stylistically needs addressing to avoid
problems in the future. I couldn't find any comments or related
historical commit messages indicating the current use is meant to take
advantage of this behavior in Python.

Change-Id: I4a89afada08b2ce220724f585631a9e2072bf1bd
Fixes: bug 1174809
Uses None instead of mutable dicts for default function arguments

Forgot to update dicts with changeset I4a89afad, which updated lists.

Change-Id: Ieca71b9c90ee5dae83a43f6851b6b8b2924bcb8e
Fixes: bug 1174809
Update to flake8 instead of pep8.

Change-Id: I3d4a31111c3044da06611405ce80f208ef8a0ce3
Adds chunk_size to CompressingFileReader.

Before when iterating using this object, the call to the underlying file object
was made without a chunk_size.  This is bad because this would cause the entire
contents of the file to be read.

Change-Id: I9956e5d2d693a6260252fff331d4f78f70179a6c
Merge "Update to flake8 instead of pep8."
Rename "file" to "disk_file"

Broke this out into a separate commit since adding five characters
caused a few lines to get re-wrapped, adding more diffs.

See John's comment from Patch Set #3 for the motivation for this
change in review https://review.openstack.org/27149.

Change-Id: I1edf2cb468dcda0b781569161ada6e4016c1141c
Signed-off-by: Peter Portante <peter.portante@redhat.com>
Merge "conf.d support"