Allow for multiple X-(Account|Container)-* headers.

When the number of account/container or container/object replicas are
different, Swift had a few misbehaviors. This commit fixes them.

* On an object PUT/POST/DELETE, if there were 3 object replicas and
  only 2 container replicas, then only 2 requests would be made to
  object servers. Now, 3 requests will be made, but the third won't
  have any X-Container-* headers in it.

* On an object PUT/POST/DELETE, if there were 3 object replicas and 4
  container replicas, then only 3/4 container servers would receive
  immediate updates; the fourth would be ignored. Now one of the
  object servers will receive multiple (comma-separated) values in the
  X-Container-* headers and it will attempt to contact both of them.

  One side effect is that multiple async_pendings may be written for
  updates to the same object. They'll have differing timestamps,
  though, so all but the newest will be deleted unread. To trigger
  this behavior, you have to have more container replicas than object
  replicas, 2 or more of the container servers must be down, and the
  headers sent to one object server must reference 2 or more down
  container servers; it's unlikely enough and the consequences are so
  minor that it didn't seem worth fixing.

The situation with account/containers is analogous, only without the
async_pendings.

Change-Id: I98bc2de93fb6b2346d6de1d764213d7563653e8d
Merge "Allow for multiple X-(Account|Container)-* headers."
Fix keystoneauth with OPTIONS headers (eg: CORS)

- Fixes bug 1101143.

Change-Id: I2a82269e4aed2c8926e0aa736c38120784e25de2
Bulk Requests: auto extract archive and bulk delete middleware.

Fix small problem in ratelimiting middleware.

DocImpact

Change-Id: Ide3e0b9f4887626c30cae0b97eb7e2237b1df3ed
Add wsgify and split_path utilities to swob

And refactor some of the code to use them.

Remove unused imports.

Change-Id: Ica479c10247fa85c740bb99cf7d1db7fbb1b2c80
Add optional locking to swift-ring-builder

If invoked as 'swift-ring-builder-safe' the directory containing the builder
file provided will be locked (via lock_parent_directory()). This provides a
small safe guard against multiple instances of the swift-ring-builder (or
other utilities that observe this lock) from attempting to write to or read
the builder/ring files while operations are in progress.

This is particularly useful in environments where ring management has been
automated (via Chef or custom solutions) but the operator still occasionally
needs to manually interact with the ring.

DocImpact

Change-Id: Ia362744a8151a91bfb586d01da582906726852e6
Handle access_log_headers in proxy_logging

 * in etc/proxy-server.conf-sample, there is an access_log_headers directive in proxy_logging middleware.
   but current code doesn't handle it. This patch enables proxy_logging to handle access_log_headers.

Change-Id: I03337ccc4f48625af3f578ed543da992d3eec2bd
Merge "Handle access_log_headers in proxy_logging"
Added fallocate_reserve option

Some systems behave badly when they completely run out of space. To
alleviate this problem, you can set the fallocate_reserve conf value
to a number of bytes to "reserve" on each disk. When the disk free
space falls at or below this amount, fallocate calls will fail, even
if the underlying OS fallocate call would succeed. For example, a
fallocate_reserve of 5368709120 (5G) would make all fallocate calls
fail, even for zero-byte files, when the disk free space falls under
5G.

The default fallocate_reserve is 0, meaning "no reserve", and so the
software behaves exactly as it always has unless you set this conf
value to something non-zero.

Also fixed ring builder's search_devs doc bugs.

Related: To get rsync to do the same, see
https://github.com/rackspace/cloudfiles-rsync
Specifically, see this patch:
https://github.com/rackspace/cloudfiles-rsync/blob/master/debian/patches/limit-fs-fullness.diff

DocImpact

Change-Id: I8db176ae0ca5b41c9bcfeb7cb8abb31c2e614527
Merge "Fix keystoneauth with OPTIONS headers (eg: CORS)"
Merge "Add wsgify and split_path utilities to swob"
Allow rebalance to take a seed.

Passing a seed into rebalance makes the rebalance deterministic
which allows us to generate identical rings across disparate
nodes without having to copy the ring files around.

Change-Id: Ie5ae46ac030e61284bc501fdef9d77eeb5243afd
Merge "Added fallocate_reserve option"
Remove tempauth allowed_sync_hosts conf option

Seems we missed these references when committing
357b12dc2ba7b19c66196a573ccb2489d2104b93

DocImpact

Change-Id: Ia226ce1d63e52769bc067d50ec4704cea4e11c5c
Cleanup based on pyflakes.

pyflakes itself can't be used in any automated gating way, because there are
two sets of false errors it raises. However, as an exercise, cleaning up the
'valid' ones uncovered three actual bugs. The other changes (mostly unused
variables) are included here for fun.

Command run: pyflakes swift | grep -v "undefined name '_'"

Change-Id: I18696bf047dedad1a9fdbde3463e214fba95f7c6
Merge "Cleanup based on pyflakes."
Merge "Allow rebalance to take a seed."