From: Patrick Donnelly Date: Tue, 1 Jul 2025 19:37:53 +0000 (-0400) Subject: common/options: chomp whitespace X-Git-Tag: testing/wip-vshankar-testing-20250721.082855-tentacle-debug~2^2~3 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=12aa7dea805dff04b10b466504f4a8f71cf7820a;p=ceph-ci.git common/options: chomp whitespace If there are trailing newlines in a string (like long_desc), then the generated C++ code is invalid (because the newline will not be escaped). Signed-off-by: Patrick Donnelly (cherry picked from commit 73792b78b4b520bcbfac254528f79a80b4d331c5) --- diff --git a/src/common/options/y2c.py b/src/common/options/y2c.py index 0b64bec58ec..9f7975af3bd 100755 --- a/src/common/options/y2c.py +++ b/src/common/options/y2c.py @@ -19,6 +19,7 @@ def level_to_cxx(lv): def eval_str(v): if v == "": return v + v = v.strip() v = v.strip('"').replace('"', '\\"') return f'"{v}"'