Add support for listing claimed messages (storage)

This patch modifies the default behavior of the message listing
interface such that both claimed and unclaimed messages will
be included in the results. A new kwarg was added to the method
so that the caller can override the default behavior.

Change-Id: I21309e986e3e0a501ca14dbfec72321fd6279565
Fixes: bug #1202430
Merge "Add support for listing claimed messages (storage)"
Exception messages are no longer marked as translatable

Change-Id: I2f63f0707bd6819673a8cd37728ce76287d05e9f
Fixes: bug #1204432
feat(storage): separate queue set_metadata()

This patch also removes the precondition checking from the
storage DriverBase class; input validation will be implemented
separately.

Change-Id: I674e6b633c3959e6a0753fcc3a36332e84a5b1ef
Implements: blueprint metadata-resource
Implements new metadata endpoint

This patchset removes the ability to specify metadata when creating a
queue as per the Marconi Weekly Meeting held on July 18th, 2013.

It also adds a new endpoint: /v1/queues/{name}/metadata with operations
- GET
- PUT

Removes:
- GET /v1/queues/{queue_name}  # replaced by metadata ^^
- the request body from PUT /v1/queues/{queue_name}

Rationale:

The addition of the metadata endpoint increases the extensibility of
the API, and decouples metadata updates from queue creation. This
makes it easier for us in the future to add other endpoints, say
/v1/queues/{name}/config for modifying special values that change the
behavior of the queue.

With that addition, creating a queue with metadata became slightly
more dangerous. In the case where a user accidentally tries to create
a queue that already exists, the metadata for the existing queue would
be overwritten by the PUT request body. By removing the ability to
modify metadata at queue creation time, it also prevents these types
of accidents.

Tests:

New unit tests added to capture expected behavior. Old tests were also
updated to reflect new endpoint and behavior.

Storage API changes:
- storage(queue): get -> get_metadata

Change-Id: Ie3a79a63a865035a789609dac770adabe4dc6ed7
Implements: blueprint metadata-resource
Tests for out of range integers

This patch adds tests for,
1. out of range integers in the JSON request
body. Refer https://trello.com/c/0anf1cMf/331-json-integer-overflowerror.
2. negative integers in grace & TTL for claims.

Tests: bug #1202846

Change-Id: I100911edf20701b16bee31949fde65148e8e4e01
fix(typo): Phython to Python

Change-Id: I51aa11fca87ac1b7ed9058c0221dc0cce1d6f7fc
Merge "Exception messages are no longer marked as translatable"
Adds test for include_claimed flag

This patch set adds test to verify that claimed messages are returned
or not, depending on the include_claimed flag.

Change-Id: I06f85b7bf78db241cbf0a2d85beac3972f64c9d0
Tests: bug #1202430
Merge "Tests for out of range integers"
Merge "Implements new metadata endpoint"
refactor: get single message in storage

This patch reapplies a262a65 by separating `bulk_get` from
the old `get` routine and back-ports changes afterwards.

Change-Id: I0018f17e959479d30252165f04d98357c93c54cf
Merge "Adds test for include_claimed flag"
Include queue ID in unclaim to trigger use of index

This patch modifies the MongoDB driver's unclaim() method
for messages so that it includes the queue ID in the
query to the database. This should allow the query
to use an index for the operation.

Change-Id: I6ae5a2f03fafd7f617d4766f3ae08fd822c887ff
Implements: blueprint api-perf-tuning
Fixes: bug #1205388
Gate on Python 3.3

This makes OS-jenkins run our tests in Python 3.3 mode in addition to
Python 2.6 and Python 2.7.

Rationale: keep our Python 3 compatibility high

Change-Id: Ia4c2964f7cc2a8e5ec0b47818698a96ec93fc892
Merge "refactor: get single message in storage"
Merge "Gate on Python 3.3"
refactor: _basic_message builder for mongo driver

Use a message building function to generate the common part
of different message bodies returned from the storage driver.

Change-Id: I2c3fd45c7e6985911b56540850258fc569d30429
Merge "refactor: _basic_message builder for mongo driver"
Verify headers in server response

This patch verifies the headers returned by the server.
Refer https://trello.com/c/Az78XtQ7/195-test-vary-header-is-set-correctly.

Change-Id: I348b30f3014b8875f3794eb8ef05bd9c19db624a