Switch over oslo.i18n

oslo.i18n has recently been released. This patch switches glance over
oslo.i18n. As per oslo.i18n's instructions, a new i18n module has been
added under glance. This module defines the translation globals and
imports the necessary functions from oslo.i18n.

The patch doesn't change the way Glance does translation, this means
that a `_` function is still being injected to the builtins.

Note that the gettextutils module is still a required module from
oslo-inc because there are oslo-inc modules that depend on the old
gettextutils module.

Change-Id: Ieb83681e35f72a5a4ecd849bb76af7f78d9fdcb0
Merge "Switch over oslo.i18n"
Allow some property operations when quota exceeded

Currently in Glance v2 if, for some reason, an image has more
properties than the image_propery_quota allows (e.g. the quota was
lowered after the image was created with properties) then any request
to modify or delete existing properties results in a 413 overlimit
error. Ideally a user should be able to remove properties or any other
action except for adding a property when they are over their quota for
a given image.

This commit does this by adding a new member to the quota.ImageProxy
class to "remember" what properties were already present in an image
*before* any new property operations are preformed on the image. After
the new property operations are performed the quotas are checked (before
writing the image info to DB) only if any new properties have been
added.

This commit does not use a subclass of ExtraPropertiesProxy to check
property quotas (in the __setitem__ method) because Glance does not
implement the JSON-patch RFC correctly - in Glance all operations in a
patch are applied and the quota checked only after all operations have
been applied (RFC requires that operations be applied sequentially and
fail on the first failure). Therefore it is possible for the quota to be
temporarily exceeded when a patch is being applied and therefore we
cannot check for quotas as they are being added - we have to wait until
all patch operations have been completed.

Also, as per review discussions in IRC, a new file:
    glance/tests/integration/v2/test_property_quota_violations.py
has been added to perform image property quota related tests (because
the functional test framework is slow).

Change-Id: Icf1b46343463791ed3d2f3ce376f11e409e792ff
Closes-bug: #1258331
Author: David Koo <david.koo@huawei.com>
Use auth_token from keystonemiddleware

The auth_token middleware in python-keystoneclient is now
deprecated and has been moved to keystonemiddleware.

Closes-Bug: #1342274

Change-Id: Ic8ba2d2f470ec052ba13c3b63b26d5e2270f7412
Add a `_retry_on_deadlock` decorator

This patch adds a `_retry_on_deadlock` decorator from Nova. The aim is
to retry db transactions that had failed because of race-conditions.
Although this is not the best and most ideal fix - it'd be better to get
rid of the race condition - the fix does adds a guard against unseen
reace conditions for some of the functions in the database API.

I'll contribute this patch to oslo.db but in the meantime, I'd prefer to
let it land in Glance and then clean it up once it's in `oslo.db`.

Change-Id: Iea1fa94a7c8690c874859b1b1e9fd1cdf29fed21
Fixes-bug: #1339735
Fix typo in swift store message

There was a missing space between words.

Change-Id: I7b5eab9df8569cf19421a372cc15c04b51b74ae0
Merge "Add a `_retry_on_deadlock` decorator"
Merge "Use auth_token from keystonemiddleware"