# Assume we'll run succesfully. If anything fails in the
# meanwhile, set this to True.
self.failed = False
+ # A logger object for this action. In the future, this might
+ # become a specific logger, that includes the action name and
+ # type.
+ self.log = log
def run(self, **kwargs):
"""
except ConfigParser.NoOptionError:
raise config.ConfigError("Option '%s' in section '%s' is mandatory, please configure it" % (option, section))
-def create_action(ty):
+def create_action(ty, **kwargs):
"""
Create a new (subclass of) Action object for an action with the
- given type.
+ given type. Any extra keyword arguments are passed to the
+ constructor.
If the handler class for this type cannot be loaded, an exception is
thrown.
% (module.__file__))
# Call the "handler" function to create the actual action
- action = module.handler()
+ action = module.handler(**kwargs)
# Check if the handler returned is really a subclass of Action
if not isinstance(action, Action):