From 49c6d9c5ece3b7274b9da13723b1ee8112f68744 Mon Sep 17 00:00:00 2001 From: Davanum Srinivas Date: Fri, 20 Mar 2015 16:04:35 -0400 Subject: [PATCH] Sync with latest oslo-incubator Pick up the changes in versionutils.py for Liberty Change-Id: I478986b484009531888f7aadb511f52c8371031a --- oslo_messaging/openstack/common/versionutils.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/oslo_messaging/openstack/common/versionutils.py b/oslo_messaging/openstack/common/versionutils.py index 0a38fa54e..1cfabddaf 100644 --- a/oslo_messaging/openstack/common/versionutils.py +++ b/oslo_messaging/openstack/common/versionutils.py @@ -17,6 +17,7 @@ Helpers for comparing version strings. """ +import copy import functools import inspect import logging @@ -32,13 +33,19 @@ LOG = logging.getLogger(__name__) CONF = cfg.CONF -opts = [ +deprecated_opts = [ cfg.BoolOpt('fatal_deprecations', default=False, help='Enables or disables fatal status of deprecations.'), ] +def list_opts(): + """Entry point for oslo.config-generator. + """ + return [(None, copy.deepcopy(deprecated_opts))] + + class deprecated(object): """A decorator to mark callables as deprecated. @@ -83,6 +90,7 @@ class deprecated(object): ICEHOUSE = 'I' JUNO = 'J' KILO = 'K' + LIBERTY = 'L' _RELEASES = { # NOTE(morganfainberg): Bexar is used for unit test purposes, it is @@ -94,6 +102,7 @@ class deprecated(object): 'I': 'Icehouse', 'J': 'Juno', 'K': 'Kilo', + 'L': 'Liberty', } _deprecated_msg_with_alternative = _( @@ -230,7 +239,7 @@ def report_deprecated_feature(logger, msg, *args, **kwargs): fatal deprecations. """ stdmsg = _("Deprecated: %s") % msg - CONF.register_opts(opts) + CONF.register_opts(deprecated_opts) if CONF.fatal_deprecations: logger.critical(stdmsg, *args, **kwargs) raise DeprecatedConfig(msg=stdmsg)