Branch: refs/heads/master
Home:
https://github.com/tribe29/checkmk
Commit: e413a0e012a0908d80ef20eb4ac74f9dad9f0967
https://github.com/tribe29/checkmk/commit/e413a0e012a0908d80ef20eb4ac74f9da…
Author: Benedikt Seidl <benedikt.seidl(a)tribe29.com>
Date: 2022-05-20 (Fri, 20 May 2022)
Changed paths:
A .werks/13420
M cmk/core_helpers/agent.py
M tests/unit/cmk/core_helpers/test_parsers.py
Log Message:
-----------
13420 FIX section parsing with different separators
In checkmk it's possible to transport a single section with different separators:
<<<section:sep(44)>>>
a,1
<<<section:sep(124)>>>
b|2
<<<section:sep(44)>>>
c,3
Up until this werk, the ordering of the lines where not preserved, the
check function would have received them as a,1 c,3 b,2
On a technical level previous to this commit all sections with the same
header (name, separator, caching etc.) where merged into a single
section. This means for the example above: "c,3" with
"<<<section:sep(44)>>>" was merged to the section
"a,1" because they
share the same section header. But this would lead to a wrong ordering:
a,1 c,3 b,2
This was done with the help of a dictionary. This dictionary was
replaced by a list and merging only takes place between the last and
the current section (if they share the same header).
CMK-10492
Change-Id: I89db1af35aa23cff72a9dc2f15cb0e4c233c0bfc