def pending(): """ Check the previous command has completed """ status, message = call_xrl(builddir(1), "finder://coord/coord/0.1/pending") if message == "pending:bool=false\n": return False else: return True
def pending(): """ Check the previous command has completed """ status, message = call_xrl(builddir(1), "finder://coord/coord/0.1/pending") if message == "pending:bool=false\n": return False else: return True
def status(peer): """ Get the status of a test peer. """ status, message = call_xrl(builddir(1), "finder://coord/coord/0.1/status?peer:txt=" + peer) message = re.sub('^status:txt=', '', message) message = re.sub('\+', ' ', message) return message
def status(peer): """ Get the status of a test peer. """ status, message = call_xrl( builddir(1), "finder://coord/coord/0.1/status?peer:txt=" + peer) message = re.sub('^status:txt=', '', message) message = re.sub('\+', ' ', message) return message
def coord(command, noblock=False): """ Send a command to the coordinator """ print command status, message = call_xrl(builddir(1), "finder://coord/coord/0.1/command?command:txt=%s" % command) if 0 != status: if noblock: print message return raise Exception, message # Wait up to five seconds for this command to complete for i in range(5): if pending() == False: return delay(1) print >> sys.stderr, "Still pending"
def coord(command, noblock=False): """ Send a command to the coordinator """ print command status, message = call_xrl( builddir(1), "finder://coord/coord/0.1/command?command:txt=%s" % command) if 0 != status: if noblock: print message return raise Exception, message # Wait up to five seconds for this command to complete for i in range(5): if pending() == False: return delay(1) print >> sys.stderr, "Still pending"