diff options
| author | Todd Willey <todd@ansolabs.com> | 2010-11-05 19:52:12 -0400 |
|---|---|---|
| committer | Todd Willey <todd@ansolabs.com> | 2010-11-05 19:52:12 -0400 |
| commit | a8a61d61db0b00e0b397c807ac8ca89e39a26c5b (patch) | |
| tree | 38694b55fcf0d6c7809ab29bf1790ee8305fc03b | |
| parent | b0f20b89e180ab0bf08373c3371c672afbe573fd (diff) | |
| download | nova-a8a61d61db0b00e0b397c807ac8ca89e39a26c5b.tar.gz nova-a8a61d61db0b00e0b397c807ac8ca89e39a26c5b.tar.xz nova-a8a61d61db0b00e0b397c807ac8ca89e39a26c5b.zip | |
Fix docstrings for wsigfied methods.
| -rw-r--r-- | doc/source/devguide/cloudpipe.rst | 8 | ||||
| -rw-r--r-- | nova/api/__init__.py | 3 | ||||
| -rw-r--r-- | nova/utils.py | 8 |
3 files changed, 19 insertions, 0 deletions
diff --git a/doc/source/devguide/cloudpipe.rst b/doc/source/devguide/cloudpipe.rst index d632a40e6..5264a0f39 100644 --- a/doc/source/devguide/cloudpipe.rst +++ b/doc/source/devguide/cloudpipe.rst @@ -67,6 +67,14 @@ The :mod:`cloudpipe` Module :undoc-members: :show-inheritance: +The :mod:`api.cloudpipe` Module +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +.. automodule:: nova.api.cloudpipe + :members: + :undoc-members: + :show-inheritance: + The :mod:`crypto` Module ~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/nova/api/__init__.py b/nova/api/__init__.py index f693225d9..1dabd3d21 100644 --- a/nova/api/__init__.py +++ b/nova/api/__init__.py @@ -30,6 +30,7 @@ import routes import webob.dec from nova import flags +from nova import utils from nova import wsgi from nova.api import cloudpipe from nova.api import ec2 @@ -83,6 +84,7 @@ class API(wsgi.Router): mapper.connect("/cloudpipe/{path_info:.*}", controller=cloudpipe.API()) super(API, self).__init__(mapper) + @utils.fix_wsgify_docstr @webob.dec.wsgify def osapi_versions(self, req): """Respond to a request for all OpenStack API versions.""" @@ -94,6 +96,7 @@ class API(wsgi.Router): "attributes": dict(version=["status", "id"])}} return wsgi.Serializer(req.environ, metadata).to_content_type(response) + @utils.fix_wsgify_docstr @webob.dec.wsgify def ec2api_versions(self, req): """Respond to a request for all EC2 versions.""" diff --git a/nova/utils.py b/nova/utils.py index e7892a212..d7ebe5b4c 100644 --- a/nova/utils.py +++ b/nova/utils.py @@ -21,6 +21,7 @@ System-level utilities and helper functions. """ import datetime +import functools import inspect import logging import os @@ -232,3 +233,10 @@ def utf8(value): return value.encode("utf-8") assert isinstance(value, str) return value + +def fix_wsgify_docstr(wsgified_func): + """A decorator to re-assign docstrings that webob.dec.wsgify clobbers.""" + @functools.wraps(wsgified_func.func) + def _f(*args, **kwargs): + wsgified_func(*args, **kwargs) + return _f |
