Пример #1
0
            raise SystemExit, 1

    if (not partitions and '-m' not in sys.argv[1:]) and (not only_id_change):
        print "Must supply either -p with value or partitions as arguments"
        print helpmsg
        raise SystemExit, 1
    


    if '--res_id' in opt_dict.keys():
        try:
            if force_id:
                scheduler.force_res_id(int(opt_dict['--res_id']))
                print "WARNING: Forcing res id to %s" % opt_dict['--res_id']
            else:
                scheduler.set_res_id(int(opt_dict['--res_id']))
                print "Setting res id to %s" % opt_dict['--res_id']
        except ValueError:
            print "res_id must be set to an integer value."
            raise SystemExit, 1
        except xmlrpclib.Fault, flt:
            print flt.faultString
            raise SystemExit, 1
        
    if '--cycle_id' in opt_dict.keys():
        try:
            if force_id:
                scheduler.force_cycle_id(int(opt_dict['--cycle_id']))
                print "WARNING: Forcing cycle id to %s" % opt_dict['--cycle_id']
            else:
                scheduler.set_cycle_id(int(opt_dict['--cycle_id']))
Пример #2
0
        if not only_id_change:
            print "--force_id can only be used with --cycle_id and/or --res_id."
            raise SystemExit, 1

    if (not partitions and '-m' not in sys.argv[1:]) and (not only_id_change):
        print "Must supply either -p with value or partitions as arguments"
        print helpmsg
        raise SystemExit, 1

    if '--res_id' in opt_dict.keys():
        try:
            if force_id:
                scheduler.force_res_id(int(opt_dict['--res_id']))
                print "WARNING: Forcing res id to %s" % opt_dict['--res_id']
            else:
                scheduler.set_res_id(int(opt_dict['--res_id']))
                print "Setting res id to %s" % opt_dict['--res_id']
        except ValueError:
            print "res_id must be set to an integer value."
            raise SystemExit, 1
        except xmlrpclib.Fault, flt:
            print flt.faultString
            raise SystemExit, 1

    if '--cycle_id' in opt_dict.keys():
        try:
            if force_id:
                scheduler.force_cycle_id(int(opt_dict['--cycle_id']))
                print "WARNING: Forcing cycle id to %s" % opt_dict['--cycle_id']
            else:
                scheduler.set_cycle_id(int(opt_dict['--cycle_id']))