Add apiclient.exceptions hierarchy

The new apiclient.exceptions hierarchy is more comprehensive
and it covers almost all HTTP error status codes. These
exceptions can be used in novaclient, keystoneclient,
glanceclient, and other client projects thus providing a
single inteface.

Users can have benefit from OpenStack clients raising exceptions
of known classes while now every client has its own classes making
difficult to catch, e.g., NotFound for every client.

Change-Id: Ia7b25880e0ffca3526525a0f0e77c7e77c4f0076
Replace auth_token middleware tests with httpretty

Httpretty will work in exactly the same way regardless of whether we use
the httplib or requests library. Convert it so we can modify the
middleware and know that our tests are still correct.

In this process we also split the tests from having V3 tests override
V2 tests, to having a base test class and V2 and V3 seperate overrides.

Change-Id: I1bfcecc6ae47a6dd5e76d4ceb8b3941e6ad1089f
Standardize base.py with novaclient

Main changes:
* deprecate api variable in favour of client
* add documentation
* use to_slug from oslo strutils
* remove Python 2.4 support
* other small fixes from novaclient

Change-Id: Ife54fd3207798ee03101a48bc1cda3b3f62cc5e4
Fix and enable gating on F811

Fixes duplicate method definitions and enables gating on F811

Change-Id: Ic360e70d13da864b8b5c10fc5e731b3952b2d2e8
Fixing potential NameErrors

Fixing a couple locations that could potentially raise NameErrors
instead of intended exceptions.  These were found by looking at
flake8 F821 (undefined name) errors.

Added in unit tests to verify NameErrors would not be raised.

Change-Id: I8619cb0be495b814335a5aea23daca025484d3c6
python3: Use from future import unicode_literals

use  "from future import unicode_literals" instead of u""

To the road to Python3, a possible next step would be to use the from __future__ import unicode_literals
and remove the u'' prefixes, as it is not supported in Python3.

Change-Id: Ic7afb3cf2d8dfad47b8a1626ab264f6d4f50d00e
Signed-off-by: Chuck Short <chuck.short@canonical.com>
Merge "python3: Use from future import unicode_literals"
Correct keyword args in test cases

In tests/test_auth_token_middleware.py, some assertRaises tests do not
pass conf as a keyword argument to self.set_middleware. This patch
correct them.

Fixes bug #1212984

Change-Id: Idd34dc043526a4eb22b28b144d327fd95aa14af2
Merge "Replace auth_token middleware tests with httpretty"
Merge "Add apiclient.exceptions hierarchy"
Merge "Fixing potential NameErrors"
Merge "Standardize base.py with novaclient"
Merge "Fix and enable gating on F811"
Remove testcase test_invalid_auth_version_request

In keystoneclient/middleware/auth_token.py, _choose_api_version(), the
codes's logic assume that auth_version in conf is always correct, so the
testcase test_invalid_auth_version_request() is incorrect. This patch
remove it.

Fixes bug #1218881

Change-Id: I6aec0526a6a60eea8d357ec1b44570e7d74da653
Merge "Correct keyword args in test cases"
Deprecation warning for the CLI

keystoneclient/shell.py's docstr is rendered by argparse as the
description for:

    $ keystone --help

Change-Id: I7355cdf533800086027824fb729eb52cdd8bbc33