fix(dovecot): handle missing inotify sysctl keys in containers

Docker containers may not expose fs.inotify.* sysctl keys at all,
causing a KeyError before the existing container guard could skip them.
This commit is contained in:
j4n
2026-04-20 10:54:15 +02:00
parent 825831ee81
commit df4ff92133

View File

@@ -186,7 +186,7 @@ def _configure_dovecot(config: Config, debug: bool = False) -> tuple[bool, bool]
can_modify = not is_in_container() can_modify = not is_in_container()
for name in ("max_user_instances", "max_user_watches"): for name in ("max_user_instances", "max_user_watches"):
key = f"fs.inotify.{name}" key = f"fs.inotify.{name}"
value = host.get_fact(Sysctl)[key] value = host.get_fact(Sysctl).get(key, 0)
if value > 65534: if value > 65534:
continue continue
if not can_modify: if not can_modify: