Skip to content

Major rewrite of configparser internal datastructures (order-dependency issues with multiused options)

This update changes the way how configuration is stored in the Python config parser data-structures. It address the order-dependency issue in both [authgoroup] and [mapping] blocks.

Previously parser distinguish only single value and multivalued options. The option name assumed to be used once, but can have several values in multivalued case.

Technically if option with the same name repeated in the configuration block - the values are recorded as array.

However mapping and authgroup options ARE NOT multivalued (we should consider to find better name for this in the arc.conf.reference).

It contains the sequence of single value options and the option name can be repeated several time in this sequence. It is sort of multiused options but not multivalued.

Old structures in the parser causes the previously hidden processing bug that appears in the complex cases. The config like this:

map_with_file=... file1
map_to_pool=... pool1
map_with_plugin=... plugin1
map_with_file=... file2
map_with_file=... file3
map_with_file=... file4

transforms into this runtime config:

map_with_file=... file1
map_with_file=... file2
map_with_file=... file3
map_with_file=... file4
map_to_pool=... pool1
map_with_plugin=... plugin1

Updated parser code in this merge request now works correctly with multiused options.

The rewrite is major, and even taking into account that I had tested every function and compare result with old parser on the same config, the new hidden bugs are possible.

Please make sure you had remove parser cache (or touch /etc/arc.conf, or reboot to cleanup entire /var/run) after update to test updated parser in action.

Edited by Maiken

Merge request reports