diff options
| author | Mark McLoughlin <markmc@redhat.com> | 2012-08-10 11:18:23 +0100 |
|---|---|---|
| committer | Mark McLoughlin <markmc@redhat.com> | 2012-08-10 11:57:58 +0100 |
| commit | 7457452a88b63505e3c90bbf218be7140713ffb5 (patch) | |
| tree | 6697d557a1402d7f77f803576ad431ee06100730 /nova/openstack | |
| parent | 043e3f5981d89d35aa8bb8f1c42561c38451dfc4 (diff) | |
| download | nova-7457452a88b63505e3c90bbf218be7140713ffb5.tar.gz nova-7457452a88b63505e3c90bbf218be7140713ffb5.tar.xz nova-7457452a88b63505e3c90bbf218be7140713ffb5.zip | |
Sync with latest version of openstack.common.cfg
Changes since last sync:
- Modifies _is_opt_registered fcn to check for duplicate opts
- allow empty config values
Change-Id: I5150404a0ff97f37d1d1f1b778736fa385d33860
Diffstat (limited to 'nova/openstack')
| -rw-r--r-- | nova/openstack/common/cfg.py | 5 | ||||
| -rw-r--r-- | nova/openstack/common/iniparser.py | 3 |
2 files changed, 6 insertions, 2 deletions
diff --git a/nova/openstack/common/cfg.py b/nova/openstack/common/cfg.py index 64411180f..c0b0161ff 100644 --- a/nova/openstack/common/cfg.py +++ b/nova/openstack/common/cfg.py @@ -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. diff --git a/nova/openstack/common/iniparser.py b/nova/openstack/common/iniparser.py index e91eea538..241284449 100644 --- a/nova/openstack/common/iniparser.py +++ b/nova/openstack/common/iniparser.py @@ -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] |
