Branch: refs/heads/2.1.0
Home:
https://github.com/tribe29/checkmk
Commit: e1e7c71531cc1697e0095315742d9930ea64170d
https://github.com/tribe29/checkmk/commit/e1e7c71531cc1697e0095315742d9930e…
Author: Christoph Rauch <christoph.rauch(a)tribe29.com>
Date: 2022-03-31 (Thu, 31 Mar 2022)
Changed paths:
A .werks/13085
M cmk/gui/fields/definitions.py
M cmk/gui/fields/utils.py
M cmk/gui/plugins/openapi/restful_objects/response_schemas.py
M cmk/gui/plugins/wato/builtin_attributes.py
M cmk/gui/watolib/host_attributes.py
M tests/unit/cmk/gui/plugins/openapi/test_openapi_host_config.py
Log Message:
-----------
13085 FIX REST API: fix missing host/folder attributes
When editing hosts or folders through the REST API there could be a case when
certain fields were not in the list of editable attributes. If a user attempted
to set this field, it would be treated as a "custom attribute" with a
potentially
different data type. This would then lead to errors.
This werk fixes the disappearing attributes (e.g. locked_by, locked_attributes).
This werk also prevents internal attribute names to be used in "custom
attributes".
There is no futher action to be taken by the user. It's in effect immediately.
Change-Id: Ifef3073b880fe7c7ba5331b9ce29604b488e1b25
Commit: 244131347270f66a030b242c43692044b3fd138f
https://github.com/tribe29/checkmk/commit/244131347270f66a030b242c43692044b…
Author: Christoph Rauch <christoph.rauch(a)tribe29.com>
Date: 2022-03-31 (Thu, 31 Mar 2022)
Changed paths:
M cmk/gui/fields/__init__.py
M cmk/gui/fields/attributes.py
M cmk/gui/fields/base.py
M cmk/gui/fields/definitions.py
M tests/unit/cmk/gui/plugins/openapi/test_openapi_host_config.py
Log Message:
-----------
fields: MultiNested now supports merging
MultiNested represents a Union of two or more
Schemas. The problem of the previous approach
was that it could only represent
"Either one or the other"
but it couldn't represent an object which had
the sum of all the keys of all objects and could
validate these keys on the sub-schemas.
This is useful in situations where e.g. some
attributes are defined statically, while others
are defined by user-data. Then you have multiple
schemas validating keys from the same object.
To achieve this, we first copy the input, then
try to decode it, then remove all sucessfully
converted keys and try again with the next sub-schema.
If no sub-schema yields any data, the operation is an error.
If one of the sub-schemas yields something, it's a success.
More than one sub-schema may yield data for an object.
This approach needs to be activated by setting "merged=True"
on instantiation of MultiNested. The default behaviour is
backwards compatible.
Change-Id: Ifbbb89a5079815f1b5d93b0e7dab034dd11026b6
Compare:
https://github.com/tribe29/checkmk/compare/984dcb0416af...244131347270