Fixed some module import fails and attacks summary file

This commit is contained in:
cr0hn
2016-02-15 16:33:18 +01:00
parent d231d5d538
commit 96cd034ed6
4 changed files with 45 additions and 9 deletions

View File

@@ -69,12 +69,18 @@ def find_modules():
for m in dir(classes):
_loaded_module = getattr(classes, m)
if inspect.isclass(_loaded_module) \
and _loaded_module.__name__ != "IModule" \
and issubclass(_loaded_module, IModule):
try:
results[_loaded_module.name] = _loaded_module
except AttributeError:
log.warning("Module '%s' has not attribute 'name' and can't be loaded." %
_loaded_module.__name__)
and _loaded_module.__name__ != "IModule":
# Check if class inherits from IModule
for c in inspect.getmro(_loaded_module):
if c.__name__ == "IModule":
try:
results[_loaded_module.name] = _loaded_module
except AttributeError:
log.warning("Module '%s' has not attribute 'name' and can't be loaded." %
_loaded_module.__name__)
# Found!
break
return results