diff options
author | Tobias Brunner <tobias@strongswan.org> | 2014-04-17 19:06:34 +0200 |
---|---|---|
committer | Martin Willi <martin@revosec.ch> | 2014-05-07 15:48:16 +0200 |
commit | e20deeca77798f6f25f78f8b5f25d0c1321f4031 (patch) | |
tree | 3b52ec580af351ac501537dd9cff48f6b1e90c14 /conf | |
parent | 5fdba04312988f31977232684386e47c3880dcfc (diff) | |
download | strongswan-e20deeca77798f6f25f78f8b5f25d0c1321f4031.tar.bz2 strongswan-e20deeca77798f6f25f78f8b5f25d0c1321f4031.tar.xz |
conf: Properly propagate whether a section is commented or not
Diffstat (limited to 'conf')
-rwxr-xr-x | conf/format-options.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/conf/format-options.py b/conf/format-options.py index fc6e6e1fd..e591f37cb 100755 --- a/conf/format-options.py +++ b/conf/format-options.py @@ -241,15 +241,16 @@ class ConfFormatter: def __print_section(self, section, indent, commented): """Print a section with all options""" - comment = "# " if commented or section.commented else "" + commented = commented or section.commented + comment = "# " if commented else "" self.__print_description(section, indent) print '{0}{1}{2} {{'.format(self.__indent * indent, comment, section.name) print for o in sorted(section.options, key=attrgetter('section')): if o.section: - self.__print_section(o, indent + 1, section.commented) + self.__print_section(o, indent + 1, commented) else: - self.__print_option(o, indent + 1, section.commented) + self.__print_option(o, indent + 1, commented) print '{0}{1}}}'.format(self.__indent * indent, comment) print |