From 65ec6529d440ea3a289fee9ce0929991d26d273b Mon Sep 17 00:00:00 2001 From: Mark McLoughlin Date: Sun, 13 May 2012 18:19:13 +0100 Subject: [PATCH] Use cfg's new group autocreation feature Change-Id: I8bd2581f01fb97afc64305743818ddc146dc14fe --- keystone/config.py | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/keystone/config.py b/keystone/config.py index 4b50f41148..e7c6acf13c 100644 --- a/keystone/config.py +++ b/keystone/config.py @@ -94,45 +94,38 @@ def setup_logging(conf): def register_str(*args, **kw): conf = kw.pop('conf', CONF) - group = _ensure_group(kw, conf) + group = kw.pop('group', None) return conf.register_opt(cfg.StrOpt(*args, **kw), group=group) def register_cli_str(*args, **kw): conf = kw.pop('conf', CONF) - group = _ensure_group(kw, conf) + group = kw.pop('group', None) return conf.register_cli_opt(cfg.StrOpt(*args, **kw), group=group) def register_bool(*args, **kw): conf = kw.pop('conf', CONF) - group = _ensure_group(kw, conf) + group = kw.pop('group', None) return conf.register_opt(cfg.BoolOpt(*args, **kw), group=group) def register_cli_bool(*args, **kw): conf = kw.pop('conf', CONF) - group = _ensure_group(kw, conf) + group = kw.pop('group', None) return conf.register_cli_opt(cfg.BoolOpt(*args, **kw), group=group) def register_int(*args, **kw): conf = kw.pop('conf', CONF) - group = _ensure_group(kw, conf) + group = kw.pop('group', None) return conf.register_opt(cfg.IntOpt(*args, **kw), group=group) def register_cli_int(*args, **kw): conf = kw.pop('conf', CONF) - group = _ensure_group(kw, conf) - return conf.register_cli_opt(cfg.IntOpt(*args, **kw), group=group) - - -def _ensure_group(kw, conf): group = kw.pop('group', None) - if group: - conf.register_group(cfg.OptGroup(name=group)) - return group + return conf.register_cli_opt(cfg.IntOpt(*args, **kw), group=group) CONF = CommonConfig(project='keystone')