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) except: print "Couldn't contact the scheduler" raise
'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]) print scheduler.check_reservations() except xmlrpclib.Fault, flt: if flt.faultCode == ComponentLookupError.fault_code: print "Couldn't contact the queue manager" sys.exit(1) else: print flt.faultString sys.exit(1) except: print "Couldn't contact the scheduler" raise