Fix test_provider_token_expiration_validation transient failure

The keystone.tests.test_token_provider.TestTokenProvider.
test_provider_token_expiration_validation test would fail if the
tests weren't run before the expiration period passed. This could
happen if the system was slow and the previous tests took a long
time causing a potential transient failure.

Change-Id: I123aadd55770002fe1c9ed9b17669d5212198aa3
Closes-Bug: #1278550
Start using to oslotest

oslotest provides a BaseTestCase class then enables proper capturing of
stdout, stderr and logging streams during a test run. We will take
advantage of this capability in the near future.

Change-Id: I16761053f631e709224eee813dc0f423f06c8870
Use assertIn in test_v3_catalog

assertEqual was used where assertIn should have been. assertIn
will provide a more useful error message.

Change-Id: I97ccbb8579ea726fd76c520d0573fdcbf5a261d7
Add a space after the hash for block comments

Automatic enforcement of this rule is added in:
https://review.openstack.org/78119

bp more-code-style-automation

Change-Id: I167d8e2e648eaf553c586f225939daddfaeddda6
Removes the use of mutables as default args

Automatic enforcement of this rule is added in:
https://review.openstack.org/78119

bp more-code-style-automation

Change-Id: I184105a456e9beae3cb3d6716b974ba52ef8bdad
Use assertIsNone when comparing against None

Automatic enforcement of this rule is added in:
https://review.openstack.org/78119

bp more-code-style-automation

Change-Id: I3969d7595494d5df5bdb072234f2facc6000ab30
Cleanup revocation query

The code in the revoke sql backend to calculate the query for the
list of events was creating a temporary and then discarding it,
and blaming not using it on sqlite.

Rather than discard the temporary, a reference is kept to it so
that it can be used.

Change-Id: Ifdb6a70900af85869b43d319eab8aa2a6b2bc162
Allows override of stdout/stderr/log capturing

During a test run stdout, stderr and log messages are being captured. If
the test fails all three will be printed out so that can be inspected.
Each stream has an environment variable that can be used to stop it from
being printed at the end of a test run by setting its value to 0. This
is in line with what many of the other project are already doing.

Environment variables:

 - OS_STDOUT_CAPTURE for stdout
 - OS_STDERR_CAPTURE for stderr
 - OS_LOG_CAPTURE for logging

Change-Id: I2fed99069950b839e060297026c8e06cbd45bb98
Use CMS to generate sample tokens

This is preparing for compressed tokens.  We don't want anything in the
keystone server tree that assumes it knows the formats of the token.
This uses the CMS code to preduce the sample data.

Change-Id: I6bf9c0f8df2e2e6d53fef4ecbcca87b9f9af4e6b
code hygiene; use six.text_type, escape regexp's, use key function

Some simple code clean up for code hygiene

Need to use unicode() rather than str() to properly handle non-ascii
characters, but to be PY2/PY3 compatible use six.text_type.

Regexp's were formed by string formatting using run-time substitutions
but the substitutions were not escaped. If the substituion contained
regexp metachars the regexp could fail.

The db key was formed by string substituion but this code was
duplicated in many places, introduce a method, key() to eliminate the
code duplication. At the same time introduce the dn() method to
transform the dn to an internal format. Currently the dn() method is a
place holder whose implementation will be added in a subsequent patch.

Change-Id: I1fbb8cf420606c77b1eed346376050f21790a8e1
Remove unnecessary test setUps

There is no reason to have a setUp case if all we do is chain to the
parent.

Change-Id: Id31281a9d50588f036e03b458ccfb71d1010f2d6
revert deprecation of v2 API

For more info, see the openstack-dev mailing list:

    http://lists.openstack.org/pipermail/openstack-dev/2014-March/031016.html

Related Blueprint:

    https://blueprints.launchpad.net/keystone/+spec/deprecate-v2-api

Change-Id: Ic160da00f1c2fbcf0589b3e1c6c93f53a4e67b72
Imported Translations from Transifex

Change-Id: Iaeae497f08f87e7a0c90b17e9b315f9de70a9e85
Avoid using .values() on the indexed columns

The length of a dict-like object should be the same as the length of the
list of values in the object, so calling .values() should be unnecessary
here.

Change-Id: I625dc7dea00cc8f09c68ea104c5c64c5f39fffc0
Closes-Bug: 1297059
Merge "Imported Translations from Transifex"
Enable lazy translations in httpd/keystone.py

This allows strings being returned in an HTTP response to be translated
into the language specified in the HTTP requests headers.

Closes-bug: #1297922
Change-Id: I8a671277f861075deddd1ee4cf5daca62a43fff7
Merge "Avoid using .values() on the indexed columns"
Open Juno development

Bump preversion to 2014.2 to formally open Juno development.
The Icehouse release branch (milestone-proposed) will be cut
from the last commit before this one.

Change-Id: I16d88d311795868b83cd13afc87dc8fbff01bfb6
Merge "revert deprecation of v2 API"
Merge "Enable lazy translations in httpd/keystone.py"