The ceilometer.openstack.common.versionutils
ModuleΒΆ
Helpers for comparing version strings.
-
exception
ceilometer.openstack.common.versionutils.
DeprecatedConfig
(msg)[source] Bases:
exceptions.Exception
-
class
ceilometer.openstack.common.versionutils.
deprecated
(as_of, in_favor_of=None, remove_in=2, what=None)[source] Bases:
object
A decorator to mark callables as deprecated.
This decorator logs a deprecation message when the callable it decorates is used. The message will include the release where the callable was deprecated, the release where it may be removed and possibly an optional replacement.
Examples:
- Specifying the required deprecated release
>>> @deprecated(as_of=deprecated.ICEHOUSE) ... def a(): pass
- Specifying a replacement:
>>> @deprecated(as_of=deprecated.ICEHOUSE, in_favor_of='f()') ... def b(): pass
- Specifying the release where the functionality may be removed:
>>> @deprecated(as_of=deprecated.ICEHOUSE, remove_in=+1) ... def c(): pass
4. Specifying the deprecated functionality will not be removed: >>> @deprecated(as_of=deprecated.ICEHOUSE, remove_in=0) ... def d(): pass
5. Specifying a replacement, deprecated functionality will not be removed: >>> @deprecated(as_of=deprecated.ICEHOUSE, in_favor_of=’f()’, remove_in=0) ... def e(): pass