Skip to content

Commit f8cdc3a

Browse files
committed
fix migration
1 parent 055fe51 commit f8cdc3a

1 file changed

Lines changed: 14 additions & 1 deletion

File tree

  • mkp/local/lib/python3/cmk_addons/plugins/yum/rulesets

mkp/local/lib/python3/cmk_addons/plugins/yum/rulesets/yum_cee.py

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,14 @@
2727
from cmk.rulesets.v1.rule_specs import AgentConfig, Topic, Title, Help
2828

2929

30-
def _migrateInt(value: object) -> Mapping[str, object]:
30+
# default interval in seconds
31+
DEFAULT_INTERVAL = 60.0
32+
33+
34+
def _migrate_int_to_float(value: object) -> Mapping[str, object]:
35+
"""
36+
migrate old integer interval to float interval
37+
"""
3138
if value is not None:
3239
if 'interval' in value:
3340
match value["interval"]:
@@ -42,7 +49,13 @@ def _migrateInt(value: object) -> Mapping[str, object]:
4249

4350

4451
def _parameter_form_yum_bakery() -> Dictionary:
52+
53+
54+
# here we need to respect the deploy dictionary -> migrate it to simple interval
55+
56+
4557
return Dictionary(
58+
migrate=_migrate_int_to_float,
4659
title=Title('YUM package update check'),
4760
help_text=Help('This will deploy the agent plugin <tt>Yum</tt>. This will activate the '
4861
'check <tt>YUM</tt> on RedHat based hosts and monitor pending normal and security updates.'

0 commit comments

Comments
 (0)