diff options
author | Zuul <zuul@review.openstack.org> | 2018-09-25 09:28:08 +0000 |
---|---|---|
committer | Gerrit Code Review <review@openstack.org> | 2018-09-25 09:28:08 +0000 |
commit | f1d779433bbe78a222aef39b69d6b59508b9d4d9 (patch) | |
tree | f7cf0ebb32fcc6292149a35452045c88aa093ba1 /ironic/drivers/base.py | |
parent | e9d9219248d26b1c9da8aa79eb25a110a9ef5ada (diff) | |
parent | 3749cd618b2b7dfc4442de06dfa5c876f9639bc7 (diff) | |
download | ironic-f1d779433bbe78a222aef39b69d6b59508b9d4d9.tar.gz |
Merge "Fix async keyword for Python 3.7"
Diffstat (limited to 'ironic/drivers/base.py')
-rw-r--r-- | ironic/drivers/base.py | 35 |
1 files changed, 7 insertions, 28 deletions
diff --git a/ironic/drivers/base.py b/ironic/drivers/base.py index a712cc43f..980ea2c67 100644 --- a/ironic/drivers/base.py +++ b/ironic/drivers/base.py @@ -646,7 +646,7 @@ VendorMetadata = collections.namedtuple('VendorMetadata', ['method', 'metadata']) -def _passthru(http_methods, method=None, async=None, async_call=None, +def _passthru(http_methods, method=None, async_call=True, driver_passthru=False, description=None, attach=False, require_exclusive_lock=True): """A decorator for registering a function as a passthru function. @@ -662,7 +662,6 @@ def _passthru(http_methods, method=None, async=None, async_call=None, :param http_methods: A list of supported HTTP methods by the vendor function. :param method: an arbitrary string describing the action to be taken. - :param async: Deprecated, please use async_call instead. :param async_call: Boolean value. If True invoke the passthru function asynchronously; if False, synchronously. If a passthru function touches the BMC we strongly recommend it to @@ -682,26 +681,6 @@ def _passthru(http_methods, method=None, async=None, async_call=None, for a synchronous passthru method. If False, don't lock the node. Defaults to True. """ - # TODO(rloo): In Stein cycle, remove support for 'async' parameter. - # The default value for 'async_call' should then be changed - # to True. - if async_call is None: - if async is not None: - LOG.warning( - 'The "async" parameter is deprecated, please use "async_call" ' - 'instead. The "async" parameter will be removed in the Stein ' - 'cycle.' - ) - async_call = async - else: - async_call = True - else: - if async is not None: - raise TypeError( - "'async_call' and 'async' parameters cannot be used together. " - "Use 'async_call' instead of 'async' since 'async' is " - "deprecated and will be removed in the Stein cycle." - ) def handle_passthru(func): api_method = method @@ -737,17 +716,17 @@ def _passthru(http_methods, method=None, async=None, async_call=None, return handle_passthru -def passthru(http_methods, method=None, async=None, description=None, - attach=False, require_exclusive_lock=True, async_call=None): - return _passthru(http_methods, method, async, async_call, +def passthru(http_methods, method=None, async_call=True, description=None, + attach=False, require_exclusive_lock=True): + return _passthru(http_methods, method, async_call, driver_passthru=False, description=description, attach=attach, require_exclusive_lock=require_exclusive_lock) -def driver_passthru(http_methods, method=None, async=None, description=None, - attach=False, async_call=None): - return _passthru(http_methods, method, async, async_call, +def driver_passthru(http_methods, method=None, async_call=True, + description=None, attach=False): + return _passthru(http_methods, method, async_call, driver_passthru=True, description=description, attach=attach) |