Support If-[Un]Modified-Since for object HEAD

We already supported it for object GET requests, but not for
HEAD. This lets clients keep metadata up-to-date without having to
either fetch the whole object when it's changed or do their own date
parsing. They can just treat Last-Modified as opaque and update their
idea of metadata when they get a 200.

Change-Id: Iff25d8989a93d651fd2c327e1e58036e79e1bde1
Update callback with proper bytes transferred

The first set of bytes transferred was being dropped.

Change-Id: I8e055190d04af1718c5e88bf5e8c44fde6794c74
Rework use of constraints to ease testing

Prior to this patch both mainline code and testing modules imported
and used constraints directly into their own namespace, or relied on
the namespace of other modules that were not the constraints
module. This meant that if a unit test wanted to change a constraint
for its operation, it had to know how that module was using the
constraint, instead of referencing the constraint module itself.

This patch unifies the use of constraints so that all constraints are
referenced via the constraints module. In turn, this allows a test to
leverage the re-loadable nature of the constraints in the constraints
module.

It addition, a number of functional tests where using the default
values for constraints, instead of the configured value discovered in
a test.conf or in an existing swift.conf. This patch removes those
direct references in favor of the load_constraint() method from the
test/functional/tests.py module.

Change-Id: Ia5313d653c667dd9ca800786de59b59334c34eaa
Only change collation for functional tests

The unconditional module-level change of the locale collation can
affect other tests run under nose. To avoid this, make the change at
the package level, and restore it when finished.

Change-Id: Iacda42aa7155f1cfa7d0dcadbf73b961dfb4b923
Read the configuration once for all func tests

Merge the swift_testing module into the functional test module itself,
so that we can read the configuration once for all unit tests, sharing
the same constraints.

Change-Id: I9fbbfdade9adca329cd79f7d4291ba009327c842
Handle getting info on wrong database type

Change-Id: I32f66f6a7683180a18a2807143d0910c75bf16f0
Merge "Rework use of constraints to ease testing"
Merge "Only change collation for functional tests"
Fixed error in container sync exc handling

If container sync got a non-ClientException and then a ClientException
during a get/put operation, it previously would break in the error
handling.

Change-Id: Ib2fa70270f3ec870bf60d5bbb3e8f514aeeb0927
Merge "Read the configuration once for all func tests"
Move module level setup under setup_package method

Perform all the package level test setup under the setup_package
method so that we only read the configuration file on disk when
functional tests are run. This let's us "play nice" with other tests.

Change-Id: I699d664bcef6754aac4ec6877830e745b764342f
Attempt to ensure connect always timesout

It seems that the test_connect_put_timeout() test does not always fail
when it is expected. Sometimes, not very often, the attempt to connect
succeeds, resulting in a failed test.

This might be because the fake-connection infrastructure uses a
sleep(0.1) and the test uses a connect timeout of 0.1. There might be a
case where the two values result in the exact time where the entries
happen to be added in the wrong order such that the sleep() completes
first before the connect timeout fires, where the connect completes
successfully.

Closes bug 1302781

Change-Id: Ie23e40cf294170eccdf0713e313f9a31a92f9071
Set permissions on generated ring files

The use of NamedTemporaryFile creates rings with permissions 0600;
however most installs probably generate the rings as root but the
swift-proxy runs as user swift.

Set the permissions on the generated ring to 0644 prior to rename so
that the swift user can read the rings.

Change-Id: Ia511931f471c5c9840012c3a75b89c1f35b1b245
Closes-Bug: #1302700
Support for content-length in the upload object method for
internal client.

Internal client uses 'chunked' transfer encoding in it's
upload_object method. If content-length is known in advance,
internal_client should allowed to use content length in the
upload_object method and not the chunked method.

Change-Id: I68d2ebde78e01fa16b7187a2f045ea20f4310722
Unify backend logging

Make account, object, and container servers construct log lines using the
same utility function so they will produce identically formatted lines.

This change reorders the fields logged for the account server.

This change also adds the "additional info" field to the two servers that
didn't log that field.  This makes the log lines identical across all 3
servers.  If people don't like that, I can take that out.  I think it makes
the documentation, parsing of the log lines, and the code a tad cleaner.

DocImpact

Change-Id: I268dc0df9dd07afa5382592a28ea37b96c6c2f44
Closes-Bug: 1280955
Add missing constraints to /info

Two of the default constraints, max_header_size and
max_meta_overall_size, don't get registered for the
/info response by the proxy server.

Rather than adding them individually to the proxy's
register_swift_info call, this patch proposes to
register all the constraints for /info at once
using the constraints.EFFECTIVE_CONSTRAINTS dict.
Any future additions to default constraints will
then be automatically included in /info.

Change-Id: I5c10d4c8eda90ba94745b6f89df85aafbb50f8ef
Merge "Handle getting info on wrong database type"
update setup.py with pbr version

This file is normally updated in the standard "update from
global requirements" patch, but since those contain other
changes we don't want, the setup.py file never gets updated.

This patch updates setup.py to bring it in line with the
standard global requirements way of doing things without also
updating [test-]requirements.txt

Change-Id: Id0e4f8e17dd4c714b4d2dd75985431a9e12e6a4f
Merge "Unify backend logging"
Fix deprecation warning

Accessing BaseException.message spews a warning; we can get the same
information with str(err), which does not spew.

Change-Id: I67648d53d25522be074a78c44b3ce97dc27d1f07