Implementation of replication servers

Support separate replication ip address:
- Added new function in utils. This function provides ability
  to select separate IP address for replication service.
- Db_replicator and object replicators were changed.
  Replication process uses new function now.

Replication network parameters:
- Replication network fields (replication_ip, replication_port)
  support was added to device dictionary in swift-ring-builder script.
- Changes were made to support new fields in search, show and set_info
  functions.

Implementation of replication servers:
- Separate replication servers use the same code as normal replication
  servers, but with replication_server parameter = True.  When using a
  separate replication network, the non-replication servers set
  replication_server = False.  When there is no separate replication
  network (the default case), replication_server is not included in the config.

DocImpact
Change-Id: Ie9af5bdcdf9241c355e36053ca4adfe49dc35bd0
Implements: blueprint dedicated-replication-network
Skip IPv6 addresses in cname_lookup middleware.

It already skips IPv4 addresses, and since IPv6 is the future of the
Internet*, we should probably do the right thing with those too.

* IPv6: Just two years away for over fifteen years!

Change-Id: I54f1db4e936fd38d05ac8b5c709efba76525b9d2
Refactor Bulk middleware to handle long running requests

Change-Id: I8ea0ff86518d453597faae44ec3918298e2d5147
Moved some code out of swift.obj.replicator

This will be needed in future replication work to avoid circular
imports.

I used swift.obj.base as the module name just because we seemed to
avoid putting code in __init__.py files so far and I didn't want to
buck the trend.

I would love to see other obj things like *_metadata and DiskFile
move into swift.obj.base as well and swift.obj.server just be the
WSGI server logic, but I'll leave that for the future.

I have changed the tests as little as possible (just the references
to where they get the code to test) to show the refactor has not
broken anything. I did add a test for tpool_reraise since there was
none before.

There will be a follow on patch for moving the tests to their new
location(s). I figured I'd wait to put the bikes in the shed until
everyone's done painting it.

Change-Id: I32b4ac88be21eb76c877d3f4cc1e6ac33304835b
Perform mount check after REST params valid on PUT

All the other methods (POST, GET, HEAD, DELETE and REPLICATE) first
validate the REST parameters and headers before performing the mount
check. Do the same for PUT.

Change-Id: I6e5f34cc65b57662b7f88224ca0e1501787e0f43
Signed-off-by: Peter Portante <peter.portante@redhat.com>
Metadata retrieving from sqlite must be str for key

Encode metadata key as utf8 if key is unicode when
retriving it from sqlite database.

Change-Id: I4ba11543d1bed17098b5e52dd768c75b403188a1
Fixes: bug #1172202
Merge "Refactor Bulk middleware to handle long running requests"
Remove dead code.

While it is true that one *could* call ContainerBroker.get_info() with
include_metadata=True, it is also true that nobody actually does.

It's also true that the code path taken when include_metadata=True is
broken in the case of non-ASCII metadata keys
(e.g. X-Container-Meta-☃: snowman), so leaving it around is just
asking for future pain.

Change-Id: I4931add4b8fb7c4f57820e52f182c21040d8db10
Merge "Implementation of replication servers"
Merge "Metadata retrieving from sqlite must be str for key"
Merge "Skip IPv6 addresses in cname_lookup middleware."
Autocreate cleanups

Autocreate was messy - now cleaned.
Auto-create now occurs at account POST, and container PUT only.
A method for autocreation was added
Autocreation was removed from account_info and container_info.

Fake-it as if the account exists on account HEAD and account GET.

Return 404 on everything else when the account does not exist.

Fix: Bug #1172223
Fix: Bug #1179140
Change-Id: Iac54c1438eb09883fbc29a1ad2ac2245b95efc92
Merge "Remove dead code."
Merge "Autocreate cleanups"
Merge "Moved some code out of swift.obj.replicator"
Move common code for two tests into a separate function.

test_get_valid and test_get_valid_key2 test tempurl with a
single key and two keys respectively. This change moves common code
for these tests into a separate function.