def print_node(self, node, attrs=[]): wrapper = Config(node) self.log.title(wrapper.displayName()) self.log.info(" - offline: %s" % wrapper.offline()) self.log.info(" - idle: %s" % wrapper.idle()) for key in attrs: self.log.info(" - %s: %s" % (key, node[key]))
def wanted_node(self, node, filters=[]): if len(filters) == 0: return True wrapper = Config(node) if wrapper.displayName() == "master": return False if "offline" in filters or "online" in filters: if wrapper.offline() and "offline" in filters: return True if wrapper.offline() and "online" in filters: return False if "idle" in filters or "busy" in filters: if wrapper.idle() and "idle" in filters: return True if wrapper.idle() and "busy" in filters: return False return False