Werk #13094: Various ValueSpec-related API cleanups

Component Checks & agents
Title Various ValueSpec-related API cleanups
Date Mar 10, 2022
Checkmk Editon Checkmk Raw (CRE)
Checkmk Version 2.2.0i1
Level Prominent Change
Class New Feature
Compatibility Incompatible - Manual interaction might be required

Various changes have been done to ValueSpec and its subclasses, improving maintainability and robustness. If you don't write your own complicated ValueSpec subclasses and you don't have any self-written complicated check parameters, you are probably not affected.

  • ValueSpec's constructor doesn't accept any random unspecifed keyword arguments anymore. It is better to raise an exception at the incorrect call site than silently accepting every typo. To fix any problems with this change, just remove the offending keyword arguments, they served no purpose after all.
  • ValueSpec.canonical_value() is an abstract method now, otherwise we force lots of places to handle None. Previously quite a few things worked only more or less by accident. If you implement your own ValueSpec subclass, you have to implement that method now, unless an intermediate class already does it for you.
  • DropdownChoice and CascadingDropdown don't have a no_preselect keyword argument anymore. It was redundant, because no_preselect_title is enough: If this keyword argument is not None, no_preselect=True is implied. Previously one could specify nonsensical combinations of those arguments. To fix any problems with this change, just drop the no_preselect keyword argument.
  • Alternative, UploadOrPasteTextFile, TextOrRegExp, and CAorCAChain don't have a style keyword argument anymore. It didn't serve any purpose since Checkmk 2.0. Just remove it.
  • TimeofdayRanges has been removed, simply use ListOfTimeRanges instead. The former has been deprecated since Checkmk 1.6.

To the list of all Werks