forked from p15670423/monkey
Allows to implement helper classes in pba files
This commit is contained in:
parent
4a8bd01a62
commit
002447e749
|
@ -40,7 +40,8 @@ class PostBreach(object):
|
||||||
# Import module from that file
|
# Import module from that file
|
||||||
module = importlib.import_module(PATH_TO_ACTIONS + pba_file)
|
module = importlib.import_module(PATH_TO_ACTIONS + pba_file)
|
||||||
# Get all classes in a module
|
# Get all classes in a module
|
||||||
pba_classes = [m[1] for m in inspect.getmembers(module, inspect.isclass) if m[1].__module__ == module.__name__]
|
pba_classes = [m[1] for m in inspect.getmembers(module, inspect.isclass)
|
||||||
|
if ((m[1].__module__ == module.__name__) and getattr(m[1], "get_pba", False))]
|
||||||
# Get post breach action object from class
|
# Get post breach action object from class
|
||||||
for pba_class in pba_classes:
|
for pba_class in pba_classes:
|
||||||
pba = pba_class.get_pba()
|
pba = pba_class.get_pba()
|
||||||
|
|
Loading…
Reference in New Issue