Allow keystoneclient to work with older keystone installs

Older keystone installs may return 501 for GET / instead of 300
like today. We should be able to assume that if 501 is returned the
server will support v2.0 only.

Fixes bug 1159911

Change-Id: If264840d8678a490264f1bdb62f1b51c362619e1
Fix optional keyring support, add basic keyring tests

Commit 06d9437e8388b369546d760607f17cb5022750e9 made using a keyring
optional by adding a function to handle the imports. The problem is that
import needs to be available at a global level for it to be usable in
other parts of the code.

The function is replaced by a top-level try/except.

Fixing the imports isn't enough to get keyring support working because
in get_auth_ref_from_keyring() the wrong token was being used when
evaluating token expiration. It was using the token already in the
HTTPClient object and not the one returned from the keyring.

Some simple tests were added to prevent future regressions. These
tests will be skipped if the keyring or pickle packages are not
installed.

Change-Id: I1fe2c9e5cdf275df2047018368da2e4b3d2d6de2
Fixes: bug #1183072
Use AuthRef for some client fields

This tackles some TODO items left over.

Change-Id: Ib062744acbf56f05d09857d244b78b35c0ef4d39
Signed-off-by: Julien Danjou <julien@danjou.info>
Merge "Allow keystoneclient to work with older keystone installs"
Cleanup shell's authentication check.

The original logic for whether shell had enough information to
authenticate a user was confusing and will be very difficult to extend
to other forms of authentication.

Change-Id: I88763a651e494e60070a30f0824505acb09310cb
Merge "Fix optional keyring support, add basic keyring tests"
Provide keystone CLI man page.

Resolves: bug 1185142
Implements blueprint: clients-man-pages

Provide basic but hopefully useful man page.

shell.rst was merged into and replaced by the man page in HTML docs.

Change-Id: I0a90e4638cc7e4ed9c02c5abd7d84a4079e5f50d
Merge "Cleanup shell's authentication check."
Merge "Provide keystone CLI man page."
Merge "Use AuthRef for some client fields"