Comment 5 for bug 1844368

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to swift (master)

Reviewed: https://review.opendev.org/685455
Committed: https://git.openstack.org/cgit/openstack/swift/commit/?id=9a33365f064c2fbde732780982e3d324b488e677
Submitter: Zuul
Branch: master

commit 9a33365f064c2fbde732780982e3d324b488e677
Author: Tim Burke <email address hidden>
Date: Fri Sep 27 11:04:43 2019 -0700

    py3: Allow percentages in configs

    Previously, configs like

        fallocate_reserve = 1%

    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.

    Change-Id: I0f9cecd11f00b522a8486972551cb30af151ce32
    Closes-Bug: #1844368