예제 #1
0
파일: setres.py 프로젝트: wtangiit/Qsim
            if start:
                updates['start'] = starttime
            if duration:
                updates['duration'] = dsec
            
        if user:
            updates['users'] = user
        if project_specified:
            updates['project'] = project
        if cycle_time:
            updates['cycle'] = cycle_time
        if partitions:
            updates['partitions'] = ":".join(partitions)
                
        scheduler.set_reservations([{'name':rname}], updates, pwd.getpwuid(os.getuid())[0])
        print scheduler.check_reservations()

        raise SystemExit, 0
    spec = { 'partitions': ":".join(partitions), 'name': nameinfo, 'users': user, 'start': starttime, 'duration': dsec, 'cycle': cycle_time, 'project': project }
    if '-q' in sys.argv:
        spec['queue'] = [opt[1] for opt in opts if opt[0] == '-q'][0]
    try:
        print scheduler.add_reservations([spec], pwd.getpwuid(os.getuid())[0])
        print scheduler.check_reservations()
    except xmlrpclib.Fault, flt:
        if flt.faultCode == ComponentLookupError.fault_code:
            print "Couldn't contact the scheduler"
            sys.exit(1)
        else:
            print flt.faultString
            sys.exit(1)
예제 #2
0
                updates['start'] = starttime
            if duration:
                updates['duration'] = dsec

        if user:
            updates['users'] = user
        if cycle_time:
            updates['cycle'] = cycle_time
        if partitions:
            updates['partitions'] = ":".join(partitions)

        scheduler.set_reservations([{
            'name': rname
        }], updates,
                                   pwd.getpwuid(os.getuid())[0])
        print scheduler.check_reservations()

        raise SystemExit, 0

    spec = {
        'partitions': ":".join(partitions),
        'name': nameinfo,
        'users': user,
        'start': starttime,
        'duration': dsec,
        'cycle': cycle_time
    }
    if '-q' in sys.argv:
        spec['queue'] = [opt[1] for opt in opts if opt[0] == '-q'][0]
    try:
        print scheduler.add_reservations([spec], pwd.getpwuid(os.getuid())[0])