Merge "Sync with latest version of openstack.common.cfg"

This commit is contained in:
Jenkins 2012-08-12 00:29:59 +00:00 committed by Gerrit Code Review
commit 7aa0fa014e
2 changed files with 6 additions and 2 deletions

View File

@ -464,7 +464,7 @@ def _is_opt_registered(opts, opt):
:raises: DuplicateOptError if a naming conflict is detected
"""
if opt.dest in opts:
if opts[opt.dest]['opt'] is not opt:
if opts[opt.dest]['opt'] != opt:
raise DuplicateOptError(opt.name)
return True
else:
@ -527,6 +527,9 @@ class Opt(object):
else:
self.deprecated_name = None
def __ne__(self, another):
return vars(self) != vars(another)
def _get_from_config_parser(self, cparser, section):
"""Retrieves the option value from a MultiConfigParser object.

View File

@ -53,7 +53,8 @@ class BaseParser(object):
key, value = line[:colon], line[colon + 1:]
value = value.strip()
if value[0] == value[-1] and value[0] == "\"" or value[0] == "'":
if ((value and value[0] == value[-1]) and
(value[0] == "\"" or value[0] == "'")):
value = value[1:-1]
return key.strip(), [value]