From aca1805d911caefe14a73edb6ced281cf54e7ad2 Mon Sep 17 00:00:00 2001 From: Julien Danjou Date: Fri, 26 Oct 2012 16:55:17 +0200 Subject: cfg: fix required if option has a dash If an option has a dash in it and is required, the check fails because it tries to self._get() on the name (with dash) rather than the dest (with underscore). Change-Id: I6448019f70f98bc2e58a325d0cf9ce88b8bb085b Signed-off-by: Julien Danjou --- openstack/common/cfg.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'openstack/common') diff --git a/openstack/common/cfg.py b/openstack/common/cfg.py index bbef49b..5adbb9a 100644 --- a/openstack/common/cfg.py +++ b/openstack/common/cfg.py @@ -1507,7 +1507,7 @@ class ConfigOpts(collections.Mapping): if ('default' in info or 'override' in info): continue - if self._get(opt.name, group) is None: + if self._get(opt.dest, group) is None: raise RequiredOptError(opt.name, group) def _parse_cli_opts(self, args): -- cgit