@@ -17,37 +17,33 @@ def load_verifier() -> InstallTargetVerifier
1717```
1818
1919This `load_verifier` function should return an instance of the custom verifier
20- for the firewall's use. The module may then be placed in the directory configured
21- on the command line (in this directory otherwise) from which verifiers should be
22- sourced for runtime import .
20+ for the firewall's use. The module may then be placed in the same directory
21+ as this source file for runtime import. Make sure to reinstall the package
22+ after doing so .
2323"""
2424
2525import importlib
2626import logging
2727import os
2828import pkgutil
29- from typing import Optional
3029
3130from scfw .verifier import InstallTargetVerifier
3231
3332_log = logging .getLogger (__name__ )
3433
3534
36- def get_install_target_verifiers (source : Optional [ str ] ) -> list [InstallTargetVerifier ]:
35+ def get_install_target_verifiers () -> list [InstallTargetVerifier ]:
3736 """
3837 Return the currently discoverable set of installation target verifiers.
3938
40- Args:
41- source: An optional directory from which to source verifiers.
42-
4339 Returns:
4440 A list of the discovered installation target verifiers.
4541 """
4642 verifiers = []
4743
48- for _ , module , _ in pkgutil .iter_modules ([source if source else os .path .dirname (__file__ )]):
44+ for _ , module , _ in pkgutil .iter_modules ([os .path .dirname (__file__ )]):
4945 try :
50- verifier = importlib .import_module (module ).load_verifier ()
46+ verifier = importlib .import_module (f". { module } " , package = __name__ ).load_verifier ()
5147 verifiers .append (verifier )
5248 except ModuleNotFoundError :
5349 _log .warning (f"Failed to load module { module } while collecting installation target verifiers" )
0 commit comments