コード例 #1
0
def container_recover(engine, server, container_obj):
    '''This function recovers a container that is in an "INCONSISTENT" state'''
    if container_obj.state == "INCONSISTENT":
        #if not recover it
        job_obj = jetstream.container.recover(server, container_obj.reference)
        #wait for the recovery action to finish
        job_context.wait(server,job_obj.reference)
        #get the updated object with the new state
        container_obj = jetstream.container.get(server, container_obj.reference)
        return container_obj
コード例 #2
0
def container_recover(engine, server, container_obj):
    """This function recovers a container that is in an "INCONSISTENT" state"""
    if container_obj.state == "INCONSISTENT":
        # if not recover it
        job_obj = jetstream.container.recover(server, container_obj.reference)
        # wait for the recovery action to finish
        job_context.wait(server, job_obj.reference)
        # get the updated object with the new state
        container_obj = jetstream.container.get(server, container_obj.reference)
        return container_obj
コード例 #3
0
def job_wait(server):
    """
    This job stops all work in the thread/process until jobs are completed.
    """
    #Grab all the jos on the server (the last 25, be default)
    all_jobs = job.get_all(server)
    #For each job in the list, check to see if it is running (not ended)
    for jobobj in all_jobs:
        if not (jobobj.job_state in ["CANCELED", "COMPLETED", "FAILED"]):
            print_debug("Waiting for " + jobobj.reference + " (currently: " + jobobj.job_state+ ") to finish running against the container")
            #If so, wait
            job_context.wait(server,jobobj.reference)
コード例 #4
0
def job_wait():
    """
    This job stops all work in the thread/process until jobs are completed.
    """
    # Grab all the jos on the server (the last 25, be default)
    all_jobs = job.get_all(server)
    # For each job in the list, check to see if it is running (not ended)
    for jobobj in all_jobs:
        if not (jobobj.job_state in ["CANCELED", "COMPLETED", "FAILED"]):
            print_debug("Waiting for " + jobobj.reference + " (currently: " +
                        jobobj.job_state +
                        ") to finish running against the container")
            # If so, wait
            job_context.wait(server, jobobj.reference)