Mark conductor 'stop' method deprecation kwarg with versions

To make it known (when the warning message is emitted) what
version this was deprecated in and when it may be removed
in add those parameters to the 'removed_kwarg' decorator so that
users of conductors are aware of this information.

Change-Id: Iacc97831ccd96d68cea4bd7e65a967b5ff9e7dc5
This commit is contained in:
Joshua Harlow
2015-02-12 17:26:41 -08:00
committed by Joshua Harlow
parent f11f7bbda7
commit 0bcd1eb863

View File

@@ -65,7 +65,8 @@ class SingleThreadedConductor(base.Conductor):
raise ValueError("Invalid timeout literal: %s" % (wait_timeout))
self._dead = threading_utils.Event()
@deprecation.removed_kwarg('timeout')
@deprecation.removed_kwarg('timeout',
version="0.8", removal_version="?")
def stop(self, timeout=None):
"""Requests the conductor to stop dispatching.
@@ -75,10 +76,10 @@ class SingleThreadedConductor(base.Conductor):
The method returns immediately regardless of whether the conductor has
been stopped.
:param timeout: This parameter is deprecated and is present for
backward compatibility. In order to wait for the
conductor to gracefully shut down, :meth:`wait` should
be used.
:param timeout: This parameter is **deprecated** and is present for
backward compatibility **only**. In order to wait for
the conductor to gracefully shut down, :meth:`wait`
should be used instead.
"""
self._wait_timeout.interrupt()