From 5211679ba90e1f1611a6f80c727bc7dd0b41fb6e Mon Sep 17 00:00:00 2001 From: Marius Sandu-Popa Date: Fri, 30 Apr 2010 15:55:02 +0300 Subject: [PATCH] autorun: fixed Commander error function invalid reference --- autorun/commander/Commander.py | 16 +++++----- autorun/commander/CommanderBase.py | 50 +++++++++++++++--------------- 2 files changed, 33 insertions(+), 33 deletions(-) diff --git a/autorun/commander/Commander.py b/autorun/commander/Commander.py index f790ffd..6b34ade 100644 --- a/autorun/commander/Commander.py +++ b/autorun/commander/Commander.py @@ -19,14 +19,14 @@ class Commander(Thread): self.Commander = CommanderBase(); self.commands = { 'list': [self.simpleC, 'Lists the nodes in xml file.'], - 'boot':[self.nodeC, 'Bootstrap server. Options: all | x .'], - 'start': [self.clientC, 'Start clients. Options: all | x | x,y .'], - 'stop': [self.clientC, 'Stop clients. Options: all | x | x,y .'], - 'status': [self.clientC,'Status clients. Options: all | x | x,y .'], + 'boot':[self.nodeC, 'Bootstrap server. Options: all | x'], + 'start': [self.clientC, 'Start clients. Options: all | x | x,y'], + 'stop': [self.clientC, 'Stop clients. Options: all | x | x,y'], + 'status': [self.clientC,'Status clients. Options: all | x | x,y'], 'archive': [self.nodeC, 'Archive output information of clients.'+\ - 'Options: all | x .'], - 'getclients': [self.nodeC,'Get running clients. Options: all | x .'], - 'getoutput': [self.nodeC,'Get clients output. Options: all | x .'], + 'Options: all | x'], + 'getclients': [self.nodeC,'Get running clients. Options: all | x'], + 'getoutput': [self.nodeC,'Get clients output. Options: all | x'], 'help': [self.simpleC, 'Show This Message.'], 'exit': [self.simpleC, 'Exit Commander.'] } @@ -251,7 +251,7 @@ class Commander(Thread): " KB/s" + ", Up:" +si.upload_limit + " KB/s" + ' )' def about(self): - print "Commander version 1.1.1" + print "Commander version 1.1" print "Enter \"help\" for instructions" if __name__ == "__main__": diff --git a/autorun/commander/CommanderBase.py b/autorun/commander/CommanderBase.py index c1c2f77..49acca8 100644 --- a/autorun/commander/CommanderBase.py +++ b/autorun/commander/CommanderBase.py @@ -44,79 +44,79 @@ class CommanderBase(): def getClients(self, public_address, listen_port): try: msg_type, msg_data = self.sendComm(public_address, - listen_port, - GET_CLIENTS, - "") + listen_port, + GET_CLIENTS, + "") if msg_type == ACK_MSG: return msg_data else: - error("get_clients", msg_data) + self.error("get_clients", msg_data) except Exception, e: print e def getOutput(self, public_address, listen_port): try: msg_type, msg_data = self.sendComm(public_address, - listen_port, - GET_OUTPUT, - "") + listen_port, + GET_OUTPUT, + "") if msg_type == ACK_MSG: return msg_data else: - error("get_output", msg_data) + self.error("get_output", msg_data) except Exception, e: print e def archive(self, public_address, listen_port): try: msg_type, msg_data = self.sendComm(public_address, - listen_port, - ARCHIVE, - "") + listen_port, + ARCHIVE, + "") if msg_type == ACK_MSG: return msg_data else: - error("archive", msg_data) + self.error("archive", msg_data) except Exception, e: print e def start(self, public_address, listen_port, config_data): try: msg_type, msg_data = self.sendComm(public_address, - listen_port, - START_MSG, - config_data) + listen_port, + START_MSG, + config_data) if msg_type == ACK_MSG: return msg_data else: - error("start_client", msg_data) + self.error("start_client", msg_data) except Exception, e: print e def stop(self, public_address, listen_port, client_pid): try: msg_type, msg_data = self.sendComm(public_address, - listen_port, - STOP_MSG, - client_pid) + listen_port, + STOP_MSG, + client_pid) if msg_type == ACK_MSG: return True else: - error("stop_client", msg_data) + self.error("stop_client", msg_data) except Exception, e: print e def status(self, public_address, listen_port, client_pid): try: msg_type, msg_data = self.sendComm(public_address, - listen_port, - GET_STATUS, - client_pid) + listen_port, + GET_STATUS, + client_pid) if msg_type == ACK_MSG: return msg_data else: - error("start_client", msg_data) + self.error("start_client", msg_data) except Exception, e: print e @@ -126,4 +126,4 @@ class CommanderBase(): def error(self, op, msg): print "[Server Error]: The server denied the " + op + " operation" print "[Server Error]: " + msg - \ No newline at end of file + -- 2.20.1