nixos-rebuild-ng: assert if get_qualified_name is used by internal modules

(cherry picked from commit b1a205154c)
This commit is contained in:
Thiago Kenji Okada
2025-05-21 12:56:38 +01:00
committed by github-actions[bot]
parent 231feee62e
commit df20fc4cbb

View File

@@ -8,4 +8,8 @@ def get_qualified_name(
) -> str:
module_name = getattr(module, "__name__", method.__module__)
method_name = getattr(method, "__qualname__", method.__name__)
return f"{module_name}.{method_name}"
name = f"{module_name}.{method_name}"
assert name.startswith("nixos_rebuild"), (
f"Non-internal module '{name}' called with 'get_qualified_name'"
)
return name