Gorka Eguileor a8edbd2e8d Improve api_version decorator to avoid noqa
Our existing `api_version` decorator for microversions forces us to use
"# noqa" if we have multiple microversions of a method in the same
class, providing no way around this.

This patch adds a way to avoid using noqa directive.  Previously we
would have:

 @wsgi.Controller.api_version("3.3")
 def my_api_method(self, req, id):
     .... method_1 ...

 @wsgi.Controller.api_version("3.4")  # noqa
 def my_api_method(self, req, id):
     .... method_2 ...

With this patch the second method does not require noqa anymore:

 @my_api_method.api_version("3.4")
 def my_api_method(self, req, id):
     .... method_2 ...

Devref is updated to reflect this new change and to mention that it is
the recommended way to do it.

Change-Id: I46283b52cc6a347d5deb0f57a123eba4e01a3eb2
Closes-Bug: #1599806
2016-07-22 10:27:26 +02:00
..
2012-05-03 10:48:26 -07:00
2013-12-03 22:49:12 +08:00
2016-05-17 08:52:21 -05:00