cloud-init icon indicating copy to clipboard operation
cloud-init copied to clipboard

chore: add typing to cloudinit.distros.parsers hostname and resolv_conf

Open Ahmedaltu opened this issue 5 months ago • 0 comments

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

Ahmedaltu avatar Jun 16 '26 13:06 Ahmedaltu