def run(self, *args, **kwargs): executor_class = self.__executor__ hostname = yield op.IMinion(self.context).hostname() interaction = db.context(self.context).get('interaction', None) executor = executor_class(hostname, self.action, interaction, timeout=self.timeout) res = yield executor.run(*args, **kwargs) defer.returnValue(res)
def execute(self, args): # we obtained `this` before the action exited from the db.transact decorator # thus we need to reapply the db proxy this.context = make_persistent_proxy(this.context, db.context(self)) return fun(this, self, args)