Helpers for comparing version strings.
Bases: exceptions.Exception
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:
>>> @deprecated(as_of=deprecated.ICEHOUSE)
... def a(): pass
>>> @deprecated(as_of=deprecated.ICEHOUSE, in_favor_of='f()')
... def b(): pass
>>> @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
Determine whether requested_version is satisfied by current_version; in other words, current_version is >= requested_version.
Parameters: |
|
---|---|
Returns: | True if compatible, False if not |
Entry point for oslo.config-generator.
Call this function when a deprecated feature is used.
If the system is configured for fatal deprecations then the message is logged at the ‘critical’ level and DeprecatedConfig will be raised.
Otherwise, the message will be logged (once) at the ‘warn’ level.
Raises: | DeprecatedConfig if the system is configured for fatal deprecations. |
---|