Missing command descriptions for 'token-get' and 'endpoint-get'

When using command "keystone help token-get" and "keystone help endpoint-get",
the description of these commands are missing. The main reason is that
keystoneclient is using the command action method's method doc as the command
description. In keystoneclient/v2_0/shell.py, the two commands' action method
are 'do_endpoint_get' and 'do_token_get'. These two methods have a decorator of
"require_service_catalog" which is a function wrapper, and this decorator has
changed the origin __doc__ of the wrapped function by default

Modify "require_service_catalog" to change the __doc__ back to the origin
function's __doc__

Change-Id: I9977a3d279529b2066667cd2ffe44dd953b4d2fb
Fixes: Bug 1182107
This commit is contained in:
xingzhou
2013-05-27 03:00:55 -04:00
parent ef6530de45
commit 2234a7cd6d

View File

@@ -36,6 +36,9 @@ def require_service_catalog(f):
raise Exception(msg)
return f(kc, args)
# Change __doc__ attribute back to origin function's __doc__
wrapped.__doc__ = f.__doc__
return wrapped