31 for m in os.listdir(checkersDirectory) |
32 for m in os.listdir(checkersDirectory) |
32 if m != "__init__.py" and m.endswith(".py") |
33 if m != "__init__.py" and m.endswith(".py") |
33 ] |
34 ] |
34 |
35 |
35 for checkerModule in checkerModules: |
36 for checkerModule in checkerModules: |
36 modName = "Security.Checks.{0}".format(checkerModule) |
|
37 try: |
37 try: |
38 mod = __import__(modName) |
38 mod = importlib.import_module("Security.Checks.{0}".format(checkerModule)) |
39 components = modName.split(".") |
|
40 for comp in components[1:]: |
|
41 mod = getattr(mod, comp) |
|
42 except ImportError: |
39 except ImportError: |
43 continue |
40 continue |
44 |
41 |
45 if not hasattr(mod, "getChecks"): |
42 if not hasattr(mod, "getChecks"): |
46 continue |
43 continue |