def run_plugin(self, force=False):
        """
        Run plugin, save result and schedule next run

        :param force: forced run
        :type force: bool
        """
        # External command will be executed
        if self.params['Command']:
            command = self.params['Command'] % self.escape(dict(self.params))
            # Execute external command to get result
            try:
                result = self.run_command(command, self.params['Timeout'])
            except Exception as e:
                lg.error("Plugin %s: %s" % (self.name, e))
                result = Result()
                result.set_status('ERROR')
                result.add_error(e)
        # Python module will be executed
        elif self.params['Module']:
            try:
                result = self.run_module(self.params['Module'])
            except Exception as e:
                lg.error("Plugin %s: %s" % (self.name, e))
                result = Result()
                result.set_status('ERROR')
                result.add_error(re.sub('^\n', '', ('%s' % e).strip()))
        # No module or command to run
        else:
            lg.error("Plugin %s: no Command or Module to execute!" % self.name)
            result = Result()
            result.set_status('ERROR')
            result.add_error('No Command or Module to execute!')

        # Run action on result
        if self.params['Action']:
            lg.debug("Plugin %s: executing action" % self.name)
            # Execute external command
            if self.params['Action']['Command']:
                # Add parameters to command with format
                params = dict(self.params, **result.result)
                params = self.escape(params)

                try:
                    action = self.run_command(self.params['Action']['Command'] % params, timeout=self.params['Action']['Timeout'])
                except Exception as e:
                    lg.error("Plugin %s: %s" % (self.name, e))
                    action = Result()
                    action.set_status('ERROR')
                    action.add_error(e)
            # Execute Python module
            elif self.params['Action']['Module']:
                try:
                    action = self.run_module(self.params['Action']['Module'], result=result)
                except Exception as e:
                    lg.error("Plugin %s: %s" % (self.name, e))
                    action = Result()
                    action.set_status('ERROR')
                    action.add_error(e)
            # No command or module to execute
            else:
                lg.error("Plugin %s: no Action Command or Module to execute!" % self.name)
                action = Result()
                action.set_status('ERROR')
                action.add_error('No Command or Module to execute!')
            # Add action result to plugin result
            result.set_action(action)

        result.set_forced(force)
        # send to the daemon
        try:
            self.result = result.get_result()
        except __HOLE__ as e:
            lg.error("Plugin %s: ValidationError: %s" % (self.name, e))
            result = Result()
            result.set_status('ERROR')
            result.add_error('ValidationError: %s' % e)
            result.set_forced(force)
            self.result = result.get_result()

        # Log result
        lg.info("Plugin %s result: %s" % (self.name, result.get_result()))
dataset/ETHPy150Open gooddata/smoker/smoker/server/plugins/__init__.py/PluginWorker.run_plugin