From: Tony Mack Date: Tue, 18 Mar 2008 23:10:17 +0000 (+0000) Subject: added start_xmlrpc_server() which is used to start a standalone xmlrpc server alterna... X-Git-Tag: tests-4.2-4~189 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=486af171bfcf5371a812fc8abc58d62bde8cfd12;p=tests.git added start_xmlrpc_server() which is used to start a standalone xmlrpc server alternate ports. Useful for running multiple api servers on the same machine --- diff --git a/qaapi/qa/PLCs.py b/qaapi/qa/PLCs.py index e16aaa7..ff0d506 100644 --- a/qaapi/qa/PLCs.py +++ b/qaapi/qa/PLCs.py @@ -27,6 +27,17 @@ class PLC(dict, Remote): self.config = config self.config.update_api(self) + def start_xmlrpc_server(self): + """ + PLCAPI comes with a SimpleServer script that allows you to run a + standalone http server that listens on the specified port. + This is useful for running multiple api servers on the same machine. + """ + if 'host' in self and not host in ['localhost', None]: + server_script = "/usr/share/plc_api/Server.py" + self.commands("%s -p %s" % (server_script, self['port'])) + + class PLCs(list, Table): def __init__(self, config, plcs):