python3: Introduce py33 to tox.ini

Introduce py33 to tox.ini to make testing with
python3 easier.

Change-Id: Id5c76d58551af4671f30ace85bdbbf5803a58368
Signed-off-by: Chuck Short <chuck.short@canonical.com>
Swift tests for unicode headers

Swift functional tests sends ilegal headers (unicode) and expects
these headers to be processed by Swift.

Apache2 seem to remove such headers which is a sound behavior for
illegal headers.

This change restrict the test tpo exist only for swift integral
web front end. For future it is advised to disallow such behaviour.
For example it is suggested to make the decission that in future APIs
illegal headers are removed rather than processed.

Change-Id: Ibf548f474de3f06a2687f8f4812beaeaf81ab216
Fixes: Bug #1189123
Add branch coverage reporting

Except where the python-nose package version does not support the
"--cover-branches" option.

Change-Id: I9ea6452d9834b3ac414e14e628002f593dd4b8c8
Signed-off-by: Peter Portante <peter.portante@redhat.com>
Add "normal", optparse-style options to swift-ring-builder add.

The old format is still present and works just like it did before, so
your existing scripts won't break.

New format pros:
 * it's readable even for Swift newcomers
 * it's easy to extend
 * it's familiar to anyone who's used a Unix command line
 * we don't have to maintain the parser

New format cons:
 * you can't add multiple devices in one go

Old format pros:
 * you can add many devices with one command
 * it's compact

Old format cons:
 * it confuses newcomers
 * "wait, is that zone dash IP colon port slash device, or zone slash
   IP dash port colon meta underscore device?" Just try walking
   someone through adding a device over voice chat.
 * it's annoying to add new fields

Note that this only affects the command "swift-ring-builder
<builderfile> add". Other swift-ring-builder commands are unchanged.

DocImpact

Change-Id: I034b7f79eb6f4d81a5c4da193e1358741441c5b5
Stop getting useless bytes on manifest Range requests.

If you make a range request for a manifest object, then the proxy can
retrieve more data than it actually needs from the object server. It
sends the right bytes to the client, and then spends a bunch of time
reading and discarding bytes it doesn't need.

Example:

   file start  	       	       	       	       	       file end
       |	range start	  range end		  |
       v	     v         	       v       	       	  v
       [--------------------------------------------------]

The proxy would send a request to the object server with "Range:
bytes=${range start}-", and so the object server responds with all the
bytes from range start to file end. This needlessly transfers all the
bytes from range end to file end, as none of those are sent to the
client.

This commit fixes the sent Range header to only request the bytes
needed.

Change-Id: Ie8d4ee2c5e67c08795ac2d39d1df7d11856621a9
Refactor DiskFile instantiation in object server.

DiskFile() takes a lot of arguments whose value is the same on every
instantiation, so I pulled that stuff out into a utility method. No
functionality change is intended.

Change-Id: I259df5602bed60d6cb48e07d6d9e58e8320ee12a
Improve swift's keystoneauth ACL support

Below three bug reports talk about one thing.
Current keystoneauth ACL supports as:

tenant_name:user_id         ok
tenant_name:user_name       no
tenant_name:*               no
tenant_id:user_id           ok
tenant_id:user_name         no
tenant_id:*                 no
*:user_id                   ok
*:user_name                 no
*:*                         no

This patch will make all of above work fine.
Applying (tenant/user)name could let user put or get their data in a
more readable way. The tenant_name:* and *:user_name is suitable for
many usage.

note: to keep compatibility here add a new keystone.identity just for
authorize() itself and leave env['keystone.identity'] to other
middlerwares.

Fixes: bug #1020709
Fixes: bug #1075362
Fixes: bug #1155389
Change-Id: I9354dedaad875117f6a9072c67e9ecf69bfca77e
Optional TCP_KEEPIDLE in unit tests

Allows to run unit tests on BSD-based platforms. The commit
da99c339 that solved the problem doesn't contain fixes of unit
tests.

Change-Id: Iff1771c1cbb37c30a888cd1da4fca5636e5797e7
bulk response Content-Type does not match request Accept header

Change-Id: Ieceed3837466c45bc2790b09cd56ae95f43dba2e
Add max_header_size to swift.conf-sample and relative UT

1. Add explanation of MAX_HEADER_SIZE into swift.conf-sample as same as
other settings in swift.conf. Especially point out the default size of
header line in eventlet is 8192 which is the main reason why we set 8192
for MAX_HEADER_SIZE in swift.

2. Add some unit tests to check valid settings in swift.conf. Test cases
in test_constraints use /etc/swift/swift.conf if exists, and if any
wrong settings are in it (MAX_META_VALE > MAX_META_OVERALL_SIZE), swift's
unit test must fail. These new unit tests is used in this case.

Change-Id: I7bb21951d46050163c1b7bceac8d49302b9209f7
Added utils.FileLikeIter

A really simple version of this was in container sync already, and I
needed a more complete version for work I'm doing, and I noticed
https://review.openstack.org/#/c/33405/ was also making use of it.
So, here's a more full version.

If https://review.openstack.org/#/c/33405/ lands before this, I'll
update it accordingly.

Change-Id: Iba66b6a97f65e312e04fdba273e8f4ad1d3e1594
Merge "Add branch coverage reporting"
Make TempURL more cache-efficient.

So, there's two cases here. In one case, we have memcache enabled;
account info gets cached in the usual place, and tempurl keys get
cached separately. In the other case, we have no cache. In neither
case is anything gained by having TempURL cache keys separately from
the account info.

This commit removes TempURL's custom caching logic and makes it rely
on get_account_info() instead.

Benefits include:
 * immediate visibility of new keys on account POST
 * less data in the cache per account --> more stuff fits in cache
 * less code for bugs to hide in

Change-Id: Idb0b6c165da14196b4c79149c546f0159b54edcb
Merge "Optional TCP_KEEPIDLE in unit tests"
Merge "Swift tests for unicode headers"
Merge "Make TempURL more cache-efficient."
version bump to 1.9.0 to reflect current dev target

Change-Id: Ia0a1b36ae90ed895dcc9876c016aaf261ad56674
use get_container_info for staticweb

Update staticweb to use get_container_info instead of its own memcache entry.

Change-Id: I59bc0d94b9e45f3d5776a5462f53b82ab78101d4
update .gitignore

Ignore build/ directory, which is auto-created when running `python
setup.py bdist` like dist/ directory.

Change-Id: Ie58936320d995e4e81f8929128475e538665bde8
Merge "Add max_header_size to swift.conf-sample and relative UT"