Fix problem with changing class attribute

Attribute get_repl_missing_table in FakeBroker class was changed in
test_replicate_object_quarantine function and not returned back. That's
why next test cases takes not expexted values from FakeBroker.

fixes bug 1180354
Change-Id: Iba55255771e6483832c7782fcbe331e20e818f4e
account-reaper warns if not making progress

DocImpact
If account reaper has not managed to clean out an account after a long
period, it prints a message to the log (you can search your system looking
for such messages). Introduce reap_warn_after config variable to determine
when to emit the message (defaults to 30 days).

Also fix bug 1181995 (edge case where object name is an empty string)

Change-Id: Ic0dfee04742d06b6a51b59f302d7a272d7c1de92
Hide the file descriptor and disk write methodology for PUTs

Towards moving the DiskFile class into place as the API definition for
pluggable DiskFile backends, we hide the file descriptor and the
method of writing data to disks. The mkstemp() method has been renamed
to writer(), and no longer returns an fd, but a new object that
encapsulates the state tracked for writes. This new object is then
used directly to perform the reminder of the write operations and
application of required semantics.

Change-Id: Ib37ed37b34a2ce6b442d69f83ca011c918114434
Signed-off-by: Peter Portante <peter.portante@redhat.com>
Merge "account-reaper warns if not making progress"
Merge "Fix problem with changing class attribute"
Retrieve the swift version with recon

Adding a '/recon/version' in order to get the swift version

Change-Id: I7b7ddbe70abb87c6a3b1010ddefa09d0acc09710
Put some comments in places we get asked about a lot

Change-Id: If932b82f4e225cfdda21f47e4215c6f4c59dae4a
Fixed probetests

* Fixed issue with running probetests with the latest update
  of python-swiftclient that removed eventlet
* Fixed issue with replication server tests to not require hard
  coded paths

Change-Id: Ibbf727ae99c0f3893ae58e270e2f879a1f618e49
Merge "Fixed probetests"
Move parse search logic outside from builder

Dramatic part of RingBuilder.search_devs which parse a complex format
of a search device string moved to the swift-ring-builder script.
Instead, the search_devs has a simple interface to search devices.

blueprint argparse-in-swift-ring-builder

Change-Id: If3dd77b297b474fb9a058e4693fef2dfb11fca3d
RingBuilder.add_dev returns device id

When added a new devices into builder the add_dev function returns it
unique id.

blueprint argparse-in-swift-ring-builder

Change-Id: I57080bb625e812f6cea71199df907a44b332b552
Handle DB creation race condition

Till now if a race occurs on a request to a DB when it is
first created, the loosing party die with 500...
... and an error stating a race is in the log file.

Both removed by simply accepting the fact that the DB is in fact
created by someone else - just less work for us to do... ;)

Fixes Bug #1051998

Change-Id: I8e29bf362edf2b1a84f9bffa39c04d5b3dc241b2
Merge "Retrieve the swift version with recon"
Rework to support RFC 2616 Sec 4.4 Message Length

RFC 2616 Sec 4.4 Message Length describes how the content-length and
transfer-encoding headers interact. Basically, if chunked transfer
encoding is used, the content-length header value is ignored and if
the content-length header is present, and the request is not using
chunked transfer-encoding, then the content-length must match the body
length.

The only Transfer-Coding value we support in the Transfer-Encoding
header (to date) is "chunked". RFC 2616 Sec 14.41 specifies that if
"multiple encodings have been applied to an entity, the
transfer-codings MUST be listed in the order in which they were
applied." Since we only supported "chunked". If the Transfer-Encoding
header value has multiple transfer-codings, we return a 501 (Not
Implemented) (see RFC 2616 Sec 3.6) without checking if chunked is the
last one specified. Finally, if transfer-encoding is anything but
"chunked", we return a 400 (Bad Request) to the client.

This patch adds a new method, message_length, to the swob request
object which will apply an algorithm based on RFC 2616 Sec 4.4
leveraging the existing content_length property.

In addition to these changes, the proxy server will now notice when
the message length specified by the content-length header is greater
than the configured object maximum size and fail the request with a
413, "Request Entity Too Large", before reading the entire body.

This work flows from https://review.openstack.org/27152.

Change-Id: I5d2a30b89092680dee9d946e1aafd017eaaef8c0
Signed-off-by: Peter Portante <peter.portante@redhat.com>
Made tests use a JSON parser in liue of eval.

The results that are being parsed are really JSON, so using a JSON parser is
more semantically correct; in addition using eval anywhere can set a bad
example.

Change-Id: Idcd55400b2571aba0f2f377cf66a3cbf4d3af960
Merge "RingBuilder.add_dev returns device id"
Move parameter checking before disk accesses

For HEAD and GET requests on both containers and accounts APIs we now
perform parameter checking before we access the database. The unit
tests were updated to show that the parameter checking is performed
before accesses are performed.

Change-Id: Ieb753316cdccabf45022e3d83522d87d34aa6b0e
Signed-off-by: Peter Portante <peter.portante@redhat.com>
Subtle change to tempurl content-disposition names

If an object name ends with a /, the content-disposition filename for
a tempurl ended up as an empty string. This fix just strips any
trailing slashes before calling basename.

Also, I added a test to verify that if the filename is passed as an
overriding query parameter, that it is used in full, no rstripping,
no basenaming.

Change-Id: I37725b6ded04ed3b91cdb21132490fd857276e2f
In TempURL, cache "no keys" for a shorter time.

In other places in the codebase, we cache a negative result for less
time (usually a tenth) than we cache a positive result. This commit
makes TempURL do the same.

This creates a slightly nicer experience for someone trying to set up
TempURL; if they get the initial key setup wrong, try it, then fix it,
it now takes only 6 seconds until they can use signed URLs, not
60. That's a short enough time that they may not even notice the
caching of no keys.

Change-Id: I521f023e7cddaecd07f0ce32aedd4059bd0b8ec4
Merge "Subtle change to tempurl content-disposition names"