From ace759e55d7c87dc66a500d598d1355dd3c0408f Mon Sep 17 00:00:00 2001 From: Mark McLoughlin Date: Tue, 17 Jul 2012 05:52:51 +0100 Subject: cfg: allow empty config values Fixes bug #1025522 Commit 83044a7 caused this to stop working in Quantum: api_extensions_path = and could only be worked around with: api_extensions_path = "" Change-Id: I8c1a57225a2c135e6baf567b8e71d61e974da4e2 --- openstack/common/iniparser.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'openstack') diff --git a/openstack/common/iniparser.py b/openstack/common/iniparser.py index e91eea5..2412844 100644 --- a/openstack/common/iniparser.py +++ b/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] -- cgit