def configure_reporter (self): try: reporter_config = self.config.section('reporter') except KeyError: self.log.warning('No reporter defined. Falling back to SimpleLogReporter.') self.reporter = reporter.SimpleLogReporter(None, self.metrics_recorder) else: reporter_klass = reporter_config.get('class') if reporter_klass is None: self.log.warning('No report class defined. Falling back to SimpleLogReporter.') self.reporter = reporter.SimpleLogReporter(None, self.metrics_recorder) else: klass = utility.find_python_object(reporter_klass) self.reporter = klass(reporter_config, self.metrics_recorder)
def setup (self): class OxidizerCallableWrapper (object): def __init__ (inself, call, conf): inself.call = call inself.conf = conf def run (inself): inself.call(inself.conf) klass = self.config.get("class") if klass is None: raise ConfigError("No class defined for this oxidizer") try: obj = utility.find_python_object(klass) except ImportError, err: raise ConfigError("Cannot find the oxidizer object: %s" % klass)