コード例 #1
0
ファイル: execution.py プロジェクト: nco/swamp
class RemoteExecutor:
    def __init__(self, url, slots):
        """ url: SOAP url for SWAMP slave
            slots: max number of running slots

            RemoteExecutor adapts a remote worker's execution resources
            so that they may be used by a parallel dispatcher.
            """
        self.url = url
        self.slots = slots
        self.rpc = SOAPProxy(url)
        log.debug("reset slave at %s with %d slots" %(url,slots))
        try:
            self.rpc.reset()
        except Exception, e:
            import traceback, sys
            tb_list = traceback.format_exception(*sys.exc_info())
            msg =  "".join(tb_list)
            raise StandardError("can't connect to "+url+str(msg))
        self.runningClusters = set()
        self.finishedClusters = set()
        self.actual = {}
        self.cmds = {}
        pass