Branch: refs/heads/master
Home:
https://github.com/tribe29/checkmk
Commit: 1ce499a031be6bdcbec06e7f783d97bf4d6324e4
https://github.com/tribe29/checkmk/commit/1ce499a031be6bdcbec06e7f783d97bf4…
Author: Mathias Laurin <mathias.laurin(a)tribe29.com>
Date: 2020-07-28 (Tue, 28 Jul 2020)
Changed paths:
M cmk/base/data_sources/_abstract.py
Log Message:
-----------
Localize usage of SectionStore
The `persisted_sections` is really only used in SNMP. We should try to
move it there. This is even more important as it is used to configure
the fetcher and should therefore not stay in the checker.
CMK-5044
Change-Id: I8e9514312b970d29cda97e1491588797e370607a
Commit: 9422032e6f4b16db208d61050a8b0ce326ff5436
https://github.com/tribe29/checkmk/commit/9422032e6f4b16db208d61050a8b0ce32…
Author: Mathias Laurin <mathias.laurin(a)tribe29.com>
Date: 2020-07-28 (Tue, 28 Jul 2020)
Changed paths:
M cmk/base/data_sources/_abstract.py
M cmk/base/data_sources/ipmi.py
M cmk/base/data_sources/piggyback.py
M cmk/base/data_sources/programs.py
M cmk/base/data_sources/snmp.py
M cmk/base/data_sources/tcp.py
Log Message:
-----------
Deobfuscate persisted_sections
`persisted_sections` is used to configure the SNMP fetcher. It should
therefore move to the SNMPConfigurator.
Analysis of the code shows that:
1. `persisted_sections` is reset upon entering `ABCDataSource._run()`.
2. `_run()` calls `_get_raw_data()` and `_get_raw_data()`
calls `_execute()`.
3. `persisted_sections` is only really used in
`SNMPDataSource._make_oid_infos()`
4. `SNMPDataSource._make_oid_infos()` is only called by
`SNMPDataSource._execute()`.
Therefore, the instance attribute was never actually used. Instead, we
pass the `persisted_sections` from `ABCDataSource._run()` to
`SNMPDataSource._make_oid_infos()`. Having it as an argument instead
of an instance variable should make further modifications easier.
CMK-5044
Change-Id: I45abdb9e29839bf0ed9a87d2939d0761fe8c005a
Compare:
https://github.com/tribe29/checkmk/compare/a49548a6da9a...9422032e6f4b