From a98f7106e38991681b5043c31134bbae272193a2 Mon Sep 17 00:00:00 2001 From: Doug Hellmann Date: Thu, 20 Jul 2017 11:24:59 -0400 Subject: [PATCH] fix formatting of literal default values with spaces When the RST parser encounters a literal value with spaces before the closing backticks, it misinterprets that as an unclosed literal expression. Fix the logic that used to add quotes around such lines, both to make the values more visible to readers of the documentation and to fix the parsing issue. Change-Id: I1bfd675d6611c59f4b3cc4816d48dbb199340bec Signed-off-by: Doug Hellmann --- oslo_config/generator.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/oslo_config/generator.py b/oslo_config/generator.py index 4b59ee9..9456bda 100644 --- a/oslo_config/generator.py +++ b/oslo_config/generator.py @@ -127,7 +127,7 @@ def _format_defaults(opt): for default_str in defaults: if not isinstance(default_str, six.text_type): default_str = six.text_type(default_str) - elif default_str.strip() != default_str: + if default_str.strip() != default_str: default_str = '"%s"' % default_str results.append(default_str) return results