def __init__(self, nodelist, imms=False): ''' Constructor nodelist is a list of hostnames for nodes to perform actions on if imms=True it will also do the same action on the imm nodes of the given nodelist nodes ''' Worker.__init__(self) self.nodelist = nodelist self.log = fancylogger.getLogger(self.__class__.__name__) self.imms = imms
def __init__(self, nodeid, clustername, masternode, commands=None): """ constructor all real nodes have an id """ Worker.__init__(self, commands=commands) self.log = fancylogger.getLogger(self.__class__.__name__) self.log.debug("creating Node %s" % nodeid) self.nodeid = nodeid self.status = None self.clustername = clustername self.slot = None self.customcmd = None self.chassisname = None self.masternode = masternode # TODO: (medium) allow for initializing this with the commands thing above # so no overwriting is needed, these can be parsed from quattor # see ticket 469 # defaults self.customCommandClass = SshCommand self.hostname = get_config('HOST_TPL') % {"nodeid": nodeid, "clustername": clustername} self.immname = get_config('IMM_TPL') % {"nodeid": nodeid, "clustername": clustername} self.immmonitoring = None self.softpoweroffCommand = SoftPoweroffCommand(self.hostname) self.softrebootCommand = SoftRebootCommand(self.hostname) # not implemented - use this command # Overwrite these in extensions # # self.poweronCommand = None # self.poweroffCommand = None # self.ledoffcommand = NotSupportedCommand("ledoff") # self.ledoncommand = NotSupportedCommand("ledon") self.statusCommand = None self.rebootCommand = None
def doIt(self): """ compatibility with the compositenode output """ out = Worker.doIt(self) return [self, out]