def main(): (config, configFiles) = getConfig(["Agent"]) publisher = instantiateImplementation(config.get("Agent", "publisher"), config) tashi.publisher = publisher client = createClient(config) logging.config.fileConfig(configFiles) agent = Primitive(config, client) #agent.conservePower() agent.start()
def __init__(self): self.config = getConfig(["Client"])[0] self.client = createClient(self.config) self.log = logging.getLogger("TashiSSH")
def __init__(self, additionalNames=[], additionalFiles=[]): from tashi.util import getConfig (config, files) = getConfig(additionalNames=additionalNames, additionalFiles=additionalFiles) self.config = config self.files = files
elif dat[0] == 'CMD=STARTJOB': r = self.processStartJob(p) elif dat[0] == 'CMD=CANCELJOB': r = self.processCancelJob(p) else: print 'got unknown packet' print p.prettyString() r = MauiPacket() r.set(['SC=-810', 'RESPONSE=command not supported']) print r.prettyString() self.ostream.write(str(r)) self.ostream.flush() self.ostream.close() self.ostream.close() self.istream.close() if __name__ == '__main__': (config, configFiles) = getConfig(["Agent"]) publisher = instantiateImplementation(config.get("Agent", "publisher"), config) tashi.publisher = publisher (client, transport) = createClient(config) logging.config.fileConfig(configFiles) tashiconnection = TashiConnection(config, client, transport) tashiconnection.start() HOST, PORT = '', 1717 server = SocketServer.TCPServer((HOST, PORT), MauiListener) server.serve_forever()