def action_execute(self, items, params):
        """ Executes arbitrary code on the node.
        """
        cmd = params.get("cmd", "hostname")
        success = True
        for item in items:
            self.logger.info("Action execute '%s' on %r", cmd, item)
            for value in self.executor.execute(
                cmd, nodes=[item]
            ).values():
                if value["ret_code"] > 0:
                    self.logger.info("Error return code: %s", value)
                    self.metric_collector.add_execute_failed_metric(item)
                    success = False
        return success
 Executes arbitrary code on the node.
        
powerfulseal/policy/action_nodes.py