Example #1
0
    def take_action(self, parsed_args):
        self.log.debug("%s" % self.config)
        for conf in sorted(self.config['plugins'],
                           # sort plugins by user-assigned weight
                           key=lambda x: x.get('weight', 100)):
            if not conf.get('enabled', False):
                self.log.debug("Skipping disabled plugin %s" % conf['name'])
                continue

            self.log.debug("loading \"{name} = {entrypoint}\"".format(
                **conf))

            plugin = load_plugin(conf)

            run_plugin(plugin)
        self.log.info("Done running plugins.")
Example #2
0
    def take_action(self, parsed_args):
        self.log.debug("%s" % self.config)

        plugin_conf = filter(lambda x: x['name'] == parsed_args.name,
                             self.config['plugins'])
        if not plugin_conf:
            self.log.warn("Plugin {} not found.".format(parsed_args.name))
            return 1

        plugin_conf = plugin_conf[0]

        self.log.debug("loading \"{name} = {entrypoint}\"".format(
            **plugin_conf))

        solo = load_plugin(plugin_conf)

        run_plugin(solo)