Add name arguments to keystone command.

This patch adds name arguments to the following subcommands:
  * role-delete
  * role-get
  * service-delete
  * service-get
  * tenant-delete
  * tenant-get
  * tenant-update
  * user-delete
  * user-get
  * user-password-update
  * user-role-add
  * user-role-list
  * user-role-remove
  * user-update

Fixes bug 1100648

Change-Id: I73c08c0ba553a72ec57ff3a684a00be4ef1294a6
Allow request timeout to be specified.

Add a new cli argument (--timeout) which
is by default 600 seconds which will be
set in the requests library so that timeouts
can occur correctly.

Change-Id: I845c55dfb6f6b8345663ccdb5b150a2655f20026
Restore Python 2.6 compatibility

Python 2.6 did not have a keyword argument 'output'
in the constructor defined yet, which caused a TypeError
exception

Change-Id: I4d455bef3480a7511172c58fd4794fa1e8acce8c
Remove useless import

Change-Id: I5925021c69883c4086e552389e987c7052ccb1cd
Signed-off-by: Julien Danjou <julien@danjou.info>
Fix thinko in self.middleware.cert_file_missing

The python function string.find() returns -1 on a miss,
which is also evaluated as True. Therefore use the
"X in Y" approach instead.

Also added a rather trivial test to test for this
code bug. In order to make the code easier to test,
I've changed the parameters to operate on the command
output, not the exception object and updated all callers.

Change-Id: If0b4fed6fe676cad50512267c1b601a3a8a631e5
Remove useless code

- There's no need to call parent init function since that's the default
  behaviour.
- The token attribute is nor used nor updated anywhere.

Change-Id: Ib0b2729a396a2d761931ce0e178c49c49814eb21
Signed-off-by: Julien Danjou <julien@danjou.info>
Take region_name into account when calling url_for

Fixes bug 1103282

When creating a Client object with region_name specified, url_for
will return an endpoint url for that region.

Change-Id: Ia5c95503fe2ed5e53de93040d70ba08a9c09f286
Factorize endpoint retrieval in access

Change-Id: Iaace7020696b238e7829dbcae60f0bc7c74a79e4
Signed-off-by: Julien Danjou <julien@danjou.info>
Fix STALE_TOKEN_DURATION usage

Change-Id: I9856684d93d8b45310e599863553a020180aa509
Signed-off-by: Julien Danjou <julien@danjou.info>
If you specify the --debug argument, it doesn't show the body of a POST request. The
body (string rep) is at 'data' in the kwargs dict. 'body' was deleted prior to this call.

Change-Id: Ieea3d11f5246ee785e41df3bc54ac61200808354
Fixes: bug #1104313
Merge "Allow request timeout to be specified."
Merge "Restore Python 2.6 compatibility"
Merge "Remove useless code"
Merge "Factorize endpoint retrieval in access"
Merge "Fix STALE_TOKEN_DURATION usage"
Merge "Fix thinko in self.middleware.cert_file_missing"
Fix how python 2.6 doesn't have assertDictEqual

Change-Id: I2e3a3dcc173bb5eae0b3e19f1c0eadc496a17e73
Merge "Take region_name into account when calling url_for"
fix discrepancies seen in domain and credential, v3 - bug 1109349

domains.py
added list method
added args private_project_names and private_user_names to create and update
credentials.py
added list method

Change-Id: I0d231e909742bb56b79c91d3d0f7dac3bd3ec552
Implements token expiration handling

This implements handling of token expiration. Once the token is expired,
this will request automatically for a new one.

A special case is introduced if the user specified a token when the client
is initialized: this is the auth_token_from_user. In this case, we can't
know the expiration date, so we just assume it will never expire and don't
handle it ourself.

Change-Id: I3771ff5d669da015d4aa259de422c5d81aed3eb4
Signed-off-by: Julien Danjou <julien@danjou.info>