Ejemplo n.º 1
0
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
Ejemplo n.º 2
0
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
Ejemplo n.º 3
0
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
Ejemplo n.º 4
0
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
Ejemplo n.º 5
0
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"
Ejemplo n.º 6
0
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"