Adds support for username to match the v2 spec

The v2.0 API spec uses username for the user's name, whereas the v3 API
just uses name. The v2.0 implementaion incorrectly used name instead of
username, but did allow a username to be specified and stored in the
extras.

This patch makes the implementation more closely conform to the API
without breaking backward compatibility. Anyone using name in the v2.0
API can continue to do so. They can even specify a username that will
still get stored in the extras. Users can now use the documented
username instead of name and the API will work for them as well.

Both name and username will always be returned for the v2 API calls.

DocImpact
Change-Id: Ia95aa5d442a8311925399fa59e5022d31f68d374
Closes-Bug: #1214686
Clean up docstrings in contrib.oauth1.core

The docstrings were using the wrong parameter name.

Change-Id: I237b2b137fa8c8f6138a4a7eacf6140843517225
derive custom exceptions directly from Exception

Although StandardError derives from Exception, the python docs for
Exception read:

    All user-defined exceptions should also be derived from this class.

http://docs.python.org/2/library/exceptions.html#exceptions.Exception

Change-Id: If0f009cd0ad5a30329f0f97d869137aeef66af23
description is wrong in endpoint filter rst doc

Literal block must start and end with blank line.

Change-Id: Ib80bc76101da34b8251d731cee5b60bde45ec099
Closes-Bug: #1269300
Don't duplicate the existing config file list

Make a copy of the original config file list for test_v3.
Otherwise additional tests end up appending to them and corrupting other tests.

Change-Id: I4232956dbfea4b1b7103c751e35112daddc5ff37
initialize environment for tests that call popen

Change-Id: I5b367f7f97de353f12e41dc7768a7fcdc740eabd
Use six to make dict work in Python 2 and Python 3

Dict's interface changed a lot between Python 2 and Python 3.
Use six to make dict work in them.
This is mapping:

six            Python 2        Python 3
six.iterkeys   dict.iterkeys   dict.keys
six.itervalues dict.itervalues dict.values
six.iteritems  dict.iteritems  dict.items

Part of blueprint keystone-py3kcompat

Change-Id: If41b19353f07853e39064f848ba74e9cdfd9bd14
Fix typos in documents and comments

Fix typos detected by toolkit misspellings.

* pip install misspellings
* git ls-files | grep -v locale | misspellings -f -

Change-Id: If986f8cfefae08089caa567618dbb13bff0d62d2
Unify StringIO usage with six.StringIO

Python 3 doesn't include StringIO.StringIO, but includes io.StringIO.
To unify StringIO usage, use six.StringIO instead.

See http://pythonhosted.org/six/#six.StringIO

Part of blueprint keystone-py3kcompat

Change-Id: Ieb03821ef6be2195ea2d58445de507dadee7e3d2
Remove unused variables from common.config

These variables were not used, so they've been removed.

Change-Id: I15e7a3f96f00fa46cbbc5132902d0b95d1a4d07c
Cleanup eventlet setup

Since environment.use_eventlet() is done in test/core.py, no need
to also do it in fixtures/appserver.py

Change-Id: I1bb4ebbca7a423ab30d945745e092cadf8817da6
Fix reading cache-time before configured

There were several places where the cache time was read at
import-time. This means that the default value is used rather
than the value that the user configured because CONF() had not
been called yet.

This change makes it so the values are read at run-time, after
CONF() has been called.

Change-Id: I835418f249c5217bf79efebad1dee22d25f6774a
Closes-Bug: #1265670
Don't configure on import

The keystone.config package called config.configure() at import-
time.

This will make it obvious that developers can't use config
options at import-time because packages that do that will fail on
import.

Change-Id: I9306f67609d782e3f49fd43908448daf1287d51c
Related-Bug: #1265108
Related-Bug: #1265670
Closes-Bug: #1269785
use assertEqual instead of assertIs for string comparison

Change-Id: I83fd4c28007e5242b69d2473d4a91f6801c49601
Merge "derive custom exceptions directly from Exception"
Merge "Don't duplicate the existing config file list"
Merge "initialize environment for tests that call popen"
Merge "Remove unused variables from common.config"
Fix test_auth isolation

When running "tox -e py27 test_auth", the first test in
test_v3_auth.TestAuthJSON would fail with an authentication error.
This is because earlier tests had already loaded up the
authentication plugins and hadn't cleared them when done. This
change makes it so that the authentication plugins are cleared in
any test loading backends so that should make sure they're always
cleared for the next test.

Change-Id: I9d47d17f1da06e65b67e092d1d733ce472d10ac5
Allow event callback registration for arbitrary resource types

In some cases events should still be able to be registered for
resource types that have not been explicitly defined due to an
extension not being loaded or active. The if-check to raise
a ValueError if the ResourceType has not been explicitly
defined by a @dependancy.provides line has been removed.

Change-Id: I9fb368c5734a4a560a4bdd97d4467e2f76ca0e5c