Fix default replication options for ring-builder add

Change-Id: I957deeb0e711bfe7cd9d852726c77179a4613ee0
Change OpenStack LLC to Foundation

Change-Id: I7c3df47c31759dbeb3105f8883e2688ada848d58
Closes-bug: #1214176
Handle X-Copy-From header in container_quota middleware

Content length of the copied object is checked before
allowing the copy request according to the container quota.

Closes-Bug: #1201875
Change-Id: If44b916791e94ac6c66eee04a5727186ce0e56ae
Two small account-quota fixes

First: even if a user has exceeded their account quota, they should be
able to make object POST requests. Updating an object's metadata isn't
going to make them any more over quota, so should be allowed.

Second: don't bother with the reseller_admin check for container or
object requests. If I send the header X-Account-Meta-Quota-Bytes: 100
on e.g. an object PUT request, the proxy will (rightly) ignore it. Now
account-quotas does too.

Change-Id: I970a76349659acdd8229a324bd33bfe7fe7261a4
Fix utf-8 handling in object versions.

Fixes object versioning when object name and/or version
container name contain multibyte utf-8 characters.

When object names containing non-ASCII characters
are PUT multiple times into a container with an
x-versions-location set, subsequent DELETE of the
object results in a 500 response status.

When the versions container name contains
non-ASCII characters the first delete of an object
succeeds but fails to restore previous version of
object, so second delete incorrectly returns 404.

Fixes bug 1229142

Change-Id: I425440f76b8328f8e119d390bfa4c7022181e89e
assertEquals is deprecated, use assertEqual

The very same functionality for fewer keystrokes.

Change-Id: I8c9513412f398132db5636fdfb7bf8301e8443cf
Stop reading from object server when client disconnects.

If a client were in the middle of an object GET request and then
disconnected, the proxy would wait a while (default 60s) and then time
out the connection. As part of the teardown for this, the proxy would
attempt to close the connection to the object server, then drain any
associated buffers. However, this didn't work particularly well,
resulting in the proxy reading the entire remainder of the object for
no gain.

Now, the proxy closes the connection hard, by calling .close() on the
underlying socket._socket object. This is different from calling
.close() on a socket._socketobject object, which is what you get back
from socket.socket() and similar methods. Calling .close() on a
socket._socketobject simply decrements a reference counter on the
socket._socket, which has been observed in the past to result in
socket leaks when something holds onto a reference. However, calling
.close() on a socket._socket actually closes the socket regardless of
who else has a reference to it.

I had to delete a test assertion that said the object server never got
SIGPIPE after a GET w/X-Newest. Well, you get a SIGPIPE when you write
to a closed socket, and now the proxy is actually closing the sockets
early, so now you *do* get a SIGPIPE.

closes-bug: 1174660

Note that this will cause a regression on bug 1037337; unfortunately,
the cure is worse than the disease, so out it goes.

Change-Id: I9c7a2e7fdb8b4232e53ea96f86b50e8d34c27221
Remove sphinx build warnings

Change-Id: Ic34bbd9cc65d96ea9b8434be7b54e5bcfae28b63
Signed-off-by: Peter Portante <peter.portante@redhat.com>
Fedora 19: need to use /etc/rc.d/rc.local

Change-Id: I80e9a4c40ff99ec09a8eeef935447c6393ea78ec
Signed-off-by: Peter Portante <peter.portante@redhat.com>
Merge "Remove sphinx build warnings"
Merge "Fedora 19: need to use /etc/rc.d/rc.local"
Fix bad hash_path reference

Mea culpa: these two scripts were missed in commit:

  https://review.openstack.org/46956

Fixes bug 1235441

Change-Id: I4303bc808448a79bddbb991526b0cca26150b392
Signed-off-by: Peter Portante <peter.portante@redhat.com>
Merge "assertEquals is deprecated, use assertEqual"
Merge "Fix default replication options for ring-builder add"
Merge "Change OpenStack LLC to Foundation"
Merge "Fix bad hash_path reference"
Revert "Refactor common/utils methods to common/ondisk"

This reverts commit 7760f41c3ce436cb23b4b8425db3749a3da33d32

Change-Id: I95e57a2563784a8cd5e995cc826afeac0eadbe62
Signed-off-by: Peter Portante <peter.portante@redhat.com>
Don't apply timeout to Pool.get operation (leaks)

The connection timeout to a memcache server is performed by using the
"with Timeout()" construct over the sock.connect() call in the
.create() method. In addition, the same construct was being applied to
the Pool.get() call in ._get_conns().

If the maximum number of connections was already created, and the
Pool.get() called took longer than the connect timeout, then the error
handling path would add a place holder to the connection
pool. Eventlet's Pool class allows for additional items to be added to
the pool, over and above the max_size setting. This additional place
holder will eventually be pulled and a new connection created to take
its place.

The fix is to remove the timeout construct in the _get_conns() method.

In addition, we also apply the unit test patch mentioned in the review
comments for Patch Set 6 of https://review.openstack.org/45134,
located at http://paste.openstack.org/show/47288/.

Fixes bug 1235027

Change-Id: I786cabefe3e8ddf7d92feb7ebc7cfb613d60a1da
Signed-off-by: Peter Portante <peter.portante@redhat.com>
Merge "Stop reading from object server when client disconnects."
Add a Timeout when getting Memcache connections

The old Timeout behavior when pulling connections of the MemcacheConnPool left
ambiguity around what timed out and could put more placeholders in the queue
than the configured max_connections.

To avoid waiting indefinitely on slow severs we raise a custom Timeout when we
fail get a connection from the pool.  We still error limit the slow server,
and move onto the next, but we still don't allow more than max_connections.

Change-Id: I9e2409896423d52da69e35c038e5f457c71f705d