From cb6bf34898771e6171ef5dbf898ec5705c904195 Mon Sep 17 00:00:00 2001 From: Russell Bryant Date: Mon, 2 Jul 2012 11:34:21 -0400 Subject: Sync iniparser from openstack-common. This patch pulls in the latest version of the iniparser module from openstack-common. It adds support for quoting option values. For example: foo = "option with a trailing space now works " Change-Id: Ia2b6e1a7888ceb04e6befe3b221e3deef9f53f0b --- nova/openstack/common/iniparser.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'nova/openstack') diff --git a/nova/openstack/common/iniparser.py b/nova/openstack/common/iniparser.py index 53ca02334..e91eea538 100644 --- a/nova/openstack/common/iniparser.py +++ b/nova/openstack/common/iniparser.py @@ -52,7 +52,10 @@ class BaseParser(object): else: key, value = line[:colon], line[colon + 1:] - return key.strip(), [value.strip()] + value = value.strip() + if value[0] == value[-1] and value[0] == "\"" or value[0] == "'": + value = value[1:-1] + return key.strip(), [value] def parse(self, lineiter): key = None -- cgit