cloud-init
cloud-init copied to clipboard
chore: add typing to cloudinit.distros.parsers hostname and resolv_conf
chore: add typing to cloudinit.distros.parsers hostname and resolv_conf
Add type annotations to fix check_untyped_defs mypy errors in:
- cloudinit/distros/parsers/hostname.py
- cloudinit/distros/parsers/resolv_conf.py
Use a _parsed flag to track parse state rather than checking truthiness of _contents, since an empty list [] is a valid parsed result for empty or comment-only input files.
Removes both modules from the mypy disabled list in pyproject.toml.
Fixes GH-5445