diff options
| author | Jenkins <jenkins@review.openstack.org> | 2012-08-12 00:29:59 +0000 |
|---|---|---|
| committer | Gerrit Code Review <review@openstack.org> | 2012-08-12 00:29:59 +0000 |
| commit | 7aa0fa014e47268b6bdc9f89c8a5d5e457056c87 (patch) | |
| tree | 3376d49dda609672b841c105aa9a1273ba0c6cbc /nova/openstack | |
| parent | 068f907fa70c89d90e3067f7647094367edd41a9 (diff) | |
| parent | 7457452a88b63505e3c90bbf218be7140713ffb5 (diff) | |
| download | nova-7aa0fa014e47268b6bdc9f89c8a5d5e457056c87.tar.gz nova-7aa0fa014e47268b6bdc9f89c8a5d5e457056c87.tar.xz nova-7aa0fa014e47268b6bdc9f89c8a5d5e457056c87.zip | |
Merge "Sync with latest version of openstack.common.cfg"
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] |
