Branch: refs/heads/master
Home:
https://github.com/tribe29/checkmk
Commit: 988d26dfedd72a1a50faeef4207bc3f96979a964
https://github.com/tribe29/checkmk/commit/988d26dfedd72a1a50faeef4207bc3f96…
Author: Lars Michelsen <lm(a)tribe29.com>
Date: 2020-09-16 (Wed, 16 Sep 2020)
Changed paths:
M cmk/base/checkers/_abstract.py
M cmk/base/checkers/snmp.py
M cmk/base/checkers/tcp.py
M cmk/base/decorator.py
M cmk/base/exceptions.py
M cmk/base/ip_lookup.py
M cmk/fetchers/_base.py
M cmk/fetchers/snmp.py
M cmk/fetchers/tcp.py
M cmk/utils/exceptions.py
M tests/unit/cmk/base/checkers/test_snmp_data_source.py
Log Message:
-----------
Moved host IP address validation to fetchers
The fetcher config creation was previously raising an
MKIPAddressLookupError in case the config creation could not gather an
resolve an IP address for one of the configured hosts. This lead to a
complete termination of the config creation.
Instead of during config creation, this validation has to be done right
before contacting the host. This change is exactly doing this.
Now the fetcher will raise an exception in the correct moment like this:
```
MKIPAddressLookupError('Failed to lookup IP address and no explicit IP address
configured')
```
What's left todo is to handle this exception correctly. This will be
fixed soon with the general error handling changes.
CMK-5295
Change-Id: I78ea68d01aef90d937edb0d7ee21991ee31ee11c
Commit: 2bb52302e5250f0553174e8a91b50ff516d44b92
https://github.com/tribe29/checkmk/commit/2bb52302e5250f0553174e8a91b50ff51…
Author: Mathias Laurin <mathias.laurin(a)tribe29.com>
Date: 2020-09-16 (Wed, 16 Sep 2020)
Changed paths:
M cmk/base/checkers/_abstract.py
M cmk/base/checkers/agent.py
M cmk/base/checkers/snmp.py
M tests/unit/cmk/base/checkers/test_agent.py
Log Message:
-----------
Consolidate persistant sections handling
The handling was split between Checker and HostSections. We move
everything into HostSections.
This should allow us to get rid of the Checker classes that have no
meaning anymore.
CMK-5450
Change-Id: Id911de649b5a76d79d9e937ceaccc25587cf29b3
Commit: 931b9e32dbb85f2579629e9c00cdae6e458233b0
https://github.com/tribe29/checkmk/commit/931b9e32dbb85f2579629e9c00cdae6e4…
Author: Mathias Laurin <mathias.laurin(a)tribe29.com>
Date: 2020-09-16 (Wed, 16 Sep 2020)
Changed paths:
M cmk/base/checkers/_abstract.py
M cmk/base/checkers/agent.py
M cmk/base/checkers/snmp.py
M cmk/base/cpu_tracking.py
M cmk/base/modes/check_mk.py
M tests/unit/cmk/base/checkers/conftest.py
M tests/unit/cmk/base/checkers/test_agent.py
M tests/unit/cmk/base/checkers/test_cmd_caching.py
M tests/unit/cmk/base/checkers/test_host_sections.py
M tests/unit/cmk/base/test_cpu_tracking.py
Log Message:
-----------
Remove *Checker classes
CMK-5450
Change-Id: I82b02587ccdda2eeadc61287b1845989457e9a6e
Commit: 320186d58f253d00b2f3486add4adaac221b3442
https://github.com/tribe29/checkmk/commit/320186d58f253d00b2f3486add4adaac2…
Author: Mathias Laurin <mathias.laurin(a)tribe29.com>
Date: 2020-09-16 (Wed, 16 Sep 2020)
Changed paths:
M cmk/base/automations/check_mk.py
M cmk/base/checkers/_abstract.py
M cmk/base/checkers/_checkers.py
M cmk/utils/type_defs.py
M tests/unit/cmk/base/checkers/test_agent.py
M tests/unit/cmk/base/checkers/test_cmd_caching.py
M tests/unit/cmk/base/checkers/test_snmp_data_source.py
M tests/unit/cmk/utils/test_type_defs.py
Log Message:
-----------
Result type: mimic OCaml instead of Rust
The interface from Rust is such that
- `Result.ok -> Optional[T_co]` and
- `Result.err -> Optional[T_err]`
where the accessors using `Optional[]` force us to litter users with
`assert .. is not None`, even after an explicit call to `Result.is_ok()`
or `Result.is_err()`. The alternative is to call the `unwrap()` methods
but here, the name of the function is unclear in Python. Indeed,
`unwrap()` transfers ownership in Rust but this concept is meaningless
in Python---CPython is reference counted.
This was also noticed in code review of code using the type.
As written in the docstring, the concept of the `Result` type from Rust
exists in a variety of programming languages. We know of three of them,
there are probably more:
- C++ has a proposal for this and calls it `std::expected`.
- It is the `Either` monad of Haskell (as noticed by SP).
- OCaml calls the type `Result` as well.
The OCaml interface is the closest to the Rust interface that we found
but does not have the drawbacks identified in Rust and it is therefore
the one we select. We do not aim to implement `join`, `bind`, `fold` or
`map` as these are more typical of a functional programming language.
This patch therefore removes the `unwrap()` methods and adds `value()`
and the rich comparison operators as defined in OCaml.
CMK-5450
Change-Id: Ie1ffe4de31826c48172183c440b493b274ea3682
Compare:
https://github.com/tribe29/checkmk/compare/55532b0c0007...320186d58f25