summaryrefslogtreecommitdiffstats
path: root/openstack
diff options
context:
space:
mode:
authorJohn Warren <jswarren@us.ibm.com>2013-08-02 16:15:26 +0000
committerJohn Warren <jswarren@us.ibm.com>2013-08-05 10:58:03 +0000
commited653bffa899dd6cabab20e4ab0283dc742e7da9 (patch)
tree4a7f762e13a245bd9b5fadf09cbf06af77ae0db9 /openstack
parent466f1391545d4a01b31b12c5dac1c0d84b0ad2d6 (diff)
downloadoslo-ed653bffa899dd6cabab20e4ab0283dc742e7da9.tar.gz
oslo-ed653bffa899dd6cabab20e4ab0283dc742e7da9.tar.xz
oslo-ed653bffa899dd6cabab20e4ab0283dc742e7da9.zip
Fix Message format-string parsing
The parsing in openstack/common/gettextutils.Message._save_dictionary_parameter does not account for two or more format directives in direct succession, e.g.: %(key1)s%(key2)s causing key/value pairs to not be copied during a mod operation. Fixes bug 1207789 Change-Id: I56940003de3e6e2fa7dd08604d04f4c57586b0a3
Diffstat (limited to 'openstack')
-rw-r--r--openstack/common/gettextutils.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/openstack/common/gettextutils.py b/openstack/common/gettextutils.py
index a90b241..bbf8fe9 100644
--- a/openstack/common/gettextutils.py
+++ b/openstack/common/gettextutils.py
@@ -137,7 +137,7 @@ class Message(UserString.UserString, object):
# look for %(blah) fields in string;
# ignore %% and deal with the
# case where % is first character on the line
- keys = re.findall('(?:[^%]|^)%\((\w*)\)[a-z]', full_msg)
+ keys = re.findall('(?:[^%]|^)?%\((\w*)\)[a-z]', full_msg)
# if we don't find any %(blah) blocks but have a %s
if not keys and re.findall('(?:[^%]|^)%[a-z]', full_msg):