Branch: refs/heads/master
Home:
https://github.com/tribe29/checkmk
Commit: 7d02206658b68879582d242add565bc5d8852d76
https://github.com/tribe29/checkmk/commit/7d02206658b68879582d242add565bc5d…
Author: Mathias Laurin <mathias.laurin(a)tribe29.com>
Date: 2021-05-17 (Mon, 17 May 2021)
Changed paths:
M cmk/core_helpers/agent.py
M tests/unit/cmk/core_helpers/test_parsers.py
Log Message:
-----------
Separate agent data parsing and modification
Now, the actual parsing, filtering with the selection, and
transformation of the parsed results are done in separate steps.
This simplifies the parser and makes the transformation of the
raw data into the `HostSections` container more explicit.
* Typing in the parser now better reflects the format of
the raw data as follows:
Union[
Mapping[SectionHeader, Content], # <<<xxx>...<<<>>>
Mapping[PiggybackHeader, # <<<<xxxx>>>>
Mapping[SectionHeader, Content] #
<<<xxx>>>...<<<>>>
] # <<<<>>>>
]
* The better typing lets us more clearly separate the mutable
containers required *during* parsing and the immutable ones used
*after* parsing.
* The more extensive parsing of the piggybacked data lets us
remove the "double-parsing" that occured in the parser and
as well as in `_make_updated_piggyback_section_header()`.
Change-Id: I9b2bf25e6a742478561e0032a2f1ae0b724767d2