

def process_GetExperimentStatus(self):
    if (self.reservation_id is None):
        return 'Reservation id not found in cookie'
    reservation_status = weblab_api.api.get_reservation_status()
    if (reservation_status.status == 'Reservation::waiting'):
        length = reservation_status.position
        status = 1
    elif (reservation_status.status == 'Reservation::waiting_confirmation'):
        length = 0
        status = 2
    elif (reservation_status.status == 'Reservation::post_reservation'):
        length = 0
        status = 3
    else:
        raise Exception(('Unexpected status in get_experimen_status: %s' % reservation_status.status))
    return ('<?xml version="1.0" encoding="utf-8"?>\n<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">\n<soap:Body>\n<GetExperimentStatusResponse xmlns="http://ilab.mit.edu">\n<GetExperimentStatusResult>\n<statusReport>\n<statusCode>%s</statusCode>\n<wait>\n<effectiveQueueLength>%s</effectiveQueueLength>\n<estWait>0</estWait>\n</wait>\n<estRuntime>0</estRuntime>\n<estRemainingRuntime>0</estRemainingRuntime>\n</statusReport>\n<minTimetoLive>0</minTimetoLive>\n</GetExperimentStatusResult>\n</GetExperimentStatusResponse>\n</soap:Body>\n</soap:Envelope>' % (status, length))

dataset/ETHPy150Open weblabdeusto/weblabdeusto/server/src/weblab/core/web/ilab.py process_GetExperimentStatus/original