would cause a py3 backend server to fail to start, complaining like
configparser.InterpolationSyntaxError: Error in file /etc/swift/object-server/1.conf.d: '%' must be followed
by '%' or '(', found: '%'
This could also come up in proxy-server configs, with things like
percent signs in tempauth password.
In general, we haven't really thought much about interpolation in
configs. Python's default ConfigParser has always supported it, though,
so we got it "for free". On py2, we didn't really have to think about
it, since values like "1%" would pass through just fine. (It would blow
up a SafeConfigParser, but a normal ConfigParser only does replacements
when there's something like a "%(opt)s" in the value.)
On py3, SafeConfigParser became ConfigParser, and the old interpolation
mode (AFAICT) doesn't exist.
Unfortunatley, since we "supported" interpolation, we have to assume
there are deployments in the wild that use it, and try not to break
them. So, do what we can to mimic the py2 behavior.
Reviewed: https:/ /review. opendev. org/685455 /git.openstack. org/cgit/ openstack/ swift/commit/ ?id=9a33365f064 c2fbde732780982 e3d324b488e677
Committed: https:/
Submitter: Zuul
Branch: master
commit 9a33365f064c2fb de732780982e3d3 24b488e677
Author: Tim Burke <email address hidden>
Date: Fri Sep 27 11:04:43 2019 -0700
py3: Allow percentages in configs
Previously, configs like
would cause a py3 backend server to fail to start, complaining like
by '%' or '(', found: '%'
This could also come up in proxy-server configs, with things like
percent signs in tempauth password.
In general, we haven't really thought much about interpolation in
configs. Python's default ConfigParser has always supported it, though,
so we got it "for free". On py2, we didn't really have to think about
it, since values like "1%" would pass through just fine. (It would blow
up a SafeConfigParser, but a normal ConfigParser only does replacements
when there's something like a "%(opt)s" in the value.)
On py3, SafeConfigParser became ConfigParser, and the old interpolation
mode (AFAICT) doesn't exist.
Unfortunatley, since we "supported" interpolation, we have to assume
there are deployments in the wild that use it, and try not to break
them. So, do what we can to mimic the py2 behavior.
Change-Id: I0f9cecd11f00b5 22a8486972551cb 30af151ce32
Closes-Bug: #1844368