From ab3a6d54c8cbd707d20b59fc736f2c35e4d13aea Mon Sep 17 00:00:00 2001 From: Lianhao Lu Date: Fri, 20 Dec 2013 11:22:03 +0800 Subject: [PATCH] Sync config generator workaround from oslo The following workaround avoid error when parsing duplicated config options during config generation, see bug 1262148 for the details. 7c18261 Temporary workaround for config generator Change-Id: Ia21afa53c5801f59dd361946716d8a18c389ada5 --- ceilometer/openstack/common/config/generator.py | 4 +++- ceilometer/openstack/common/gettextutils.py | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/ceilometer/openstack/common/config/generator.py b/ceilometer/openstack/common/config/generator.py index 3798ee61a..74819b460 100644 --- a/ceilometer/openstack/common/config/generator.py +++ b/ceilometer/openstack/common/config/generator.py @@ -121,7 +121,9 @@ def _import_module(mod_str): def _is_in_group(opt, group): "Check if opt is in group." for key, value in group._opts.items(): - if value['opt'] == opt: + # NOTE(llu): Temporary workaround for bug #1262148, wait until + # newly released oslo.config support '==' operator. + if not(value['opt'] != opt): return True return False diff --git a/ceilometer/openstack/common/gettextutils.py b/ceilometer/openstack/common/gettextutils.py index 0cd85124d..bf060999a 100644 --- a/ceilometer/openstack/common/gettextutils.py +++ b/ceilometer/openstack/common/gettextutils.py @@ -19,7 +19,7 @@ gettext for openstack-common modules. Usual usage in an openstack.common module: - from ceilometer.openstack.common.gettextutils import _ + from ceilometer.openstack.common.gettextutils import _ # noqa """ import copy