Handle COPY verb in account quota middleware

Since COPY verb allow to copy an existing object
we must check the size of the source object before
allowing the copy.

Fixes bug: #1201884

Change-Id: Ia37bc716be0c3e5a3174dc4370bb5084f81073ad
improve docs in etc/dispersion.conf-sample

1. add a comment to hint using a new account for using dispersion tools
2. change sample url for keystone from 'saio' to 'localhost'

Change-Id: I4683f5eb0af534b39112f1b7420f67d569c29b3a
Fix quarantine, error counts in audit logs

Any quarantines and errors that happened between the last recon dump
and the end of an audit pass weren't getting counted in the logs.

This is particularly easy to see on a mostly-empty SAIO: go corrupt a
file, and the auditor will probably tell you (a) that it's
quarantining a file, and then (b) that 0 files were quarantined.

Change-Id: I78e32b911e457078144564e3be42527260148ade
Remove some WebOb leftovers.

The deleted comments were talking about a swob EmptyResponse object,
which doesn't exist; it seems this was left over from the big WebOb
removal. Also, swob doesn't exhibit that behavior, so there's no point
in having this extra code path around.

Further, it seems like the hack was only needed with WebOb < 1.0.8. I
went back to Swift 1.4.8 (Essex) and compared it to master, and this
is the result:

DLO manifest HEAD
=================

Essex (ffadbc3)
---------------
Small #segments --> Content-Length: 12345
Large #segments --> Content-Length: 0
Large #segments sans shenanigans --> Content-Length: 0

master (f63b58f)
----------------
Small #segments --> Content-Length: 12345
Large #segments --> Content-Length: 0
Large #segments sans shenanigans --> Content-Length: 0

So, whatever WebOb wackiness this was intended to hack around, it
doesn't seem to have been here for a long, long time.

Change-Id: I7b717b1b36de1139cc5b76c166d1715dbc34b332
Fix probe test

Fix for a probe test that failed every once in a
while due to the early-majority change previously
committed. Sometimes a write would return success
before the third node had succeeded and the probe
test would look for on-disk evidence and fail,
when it would've been fine had it waited just a
bit longer for the third node to complete.

Since there's no real way for the probe test to
know when all three nodes are done, I just made
it retry once a second for several seconds before
reporting an error.

There may be more tests like this we'll have to
fix as we run across them.

Change-Id: I749e43d4580a7c726a9a8648f71bafefa70a05f5
Merge "Remove some WebOb leftovers."
catch OSError to prevent breaking request /recon/diskusage

swift.common.utils.ismount maybe raise some OSError in some special
cases; and the request against /recon/diskusage doesn't handle it
before. This patch let output of mounted keyword is the error's message.

Change-Id: I5d9018f580181e618a3fa072b7a760d41795d8eb
Closes-Bug: #1249181
Fix test to work with mock 0.8.0

This particular test case used a construct that worked in mock 1.0,
but not in 0.8. Our test-requirements.txt says mock>=0.8.0.

Change-Id: I93ed4b7b5d169572bbed6490cb9b0dd421a3b9e2
Add swiftsync.

Change-Id: Ie588db762aedc55e00f8f51b3d2e329ba9a08a6c
Fix UnboundLocalError on container PUT

Fixes bug-1243973

Change-Id: If165fdcccb5d4712570b1cdabcc89e618f539849
minor fix to unittest fake error

Change-Id: Ife7add5646afb94ec56a38f335112ab70998b1b1
Use utils.ismount in place of os.path.ismount

See comments from: https://review.openstack.org/55991

Change-Id: Ibb4153702b3dc4c60f66abb11cd3fa1953449827
Signed-off-by: Peter Portante <peter.portante@redhat.com>
Replace httplib with bufferedhttp in sphinx docs

We also replace references in a few comments as well.

Change-Id: Ifc8d78e943219fefc73f41abed7d393a060e3926
Signed-off-by: Peter Portante <peter.portante@redhat.com>
Quiet all locale warnings and dummy thread, too

Change-Id: I0c68b94ec234e470ce2d50da01d8ae1cd10fae58
Signed-off-by: Peter Portante <peter.portante@redhat.com>
Use POST in bulk-delete

The DELETE verb applies to a single resource, and doesn't define any
semantics for the body.

http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html#sec9.7

The swift Bulk Delete command affects multiple resources specified in a
DELETE body.

http://docs.openstack.org/developer/swift/misc.html#module-swift.common.middleware.bulk

While Bulk Delete is a welcome operation, its usage of DELETE is
unusual: affecting multiple resources and relying on reading content.

More typically, such an operation employs POST (or PUT), which folks
including api-craft usually agree is the best "catch-all" verb for
behaviors such as those affecting multiple resources. That's the TL;DR;
of the thread below.

https://groups.google.com/forum/#!searchin/api-craft/Regarding$20Bulk$20actions/api-craft/wY-W1NdZDRs/7YDwMhCR608J

Note that this topic isn't nasal or abstract. The current behavior is
unsupported using the built-in java http client. Even if third-party
libraries can work around this behavior, it is probably best to not be a
snowflake wrt http verb semantics where possible!

http://stackoverflow.com/questions/9100776/http-delete-with-request-body-issues

DocImpact

Closes-Bug: #1232787
Change-Id: I0fc74c85618fe4dd7ff5e7f9756c7f6f67aa0465
Fixed concurrent PUT requests to accounts or containers

When concurrent PUT requests come in for an account or container, the
resulting DB access will try to lock the DB for writing. Normal access
will retry when it encounters a locked DB, change 0fdad0d9 introduced
a cursor for doing the initialization which did not have the retry
capability, resulting in a hard failure.

Fixes bug 1243973

Change-Id: I73b219e0f5eacf314d87b4d5e56c03daf51b2eca
Merge "Fixed concurrent PUT requests to accounts or containers"
Merge "improve docs in etc/dispersion.conf-sample"
Merge "Use utils.ismount in place of os.path.ismount"
Merge "minor fix to unittest fake error"