Revision 1338f2b4

b/Makefile.am
116 116
	lib/ssh.py \
117 117
	lib/storage.py \
118 118
	lib/utils.py \
119
	lib/uidpool.py \
119 120
	lib/workerpool.py
120 121

  
121 122
hypervisor_PYTHON = \
b/lib/cli.py
124 124
  "SYNC_OPT",
125 125
  "TAG_SRC_OPT",
126 126
  "TIMEOUT_OPT",
127
  "UIDPOOL_OPT",
127 128
  "USEUNITS_OPT",
128 129
  "USE_REPL_NET_OPT",
129 130
  "VERBOSE_OPT",
......
929 930
               " the current cluster defaults and set them as such, instead"
930 931
               " of marking them as overridden")
931 932

  
933
UIDPOOL_OPT = cli_option("--uid-pool", default=None,
934
                         action="store", dest="uid_pool",
935
                         help=("A list of user-ids or user-id"
936
                               " ranges separated by commas"))
937

  
932 938

  
933 939
def _ParseArgs(argv, commands, aliases):
934 940
  """Parser for the command line arguments.
b/lib/cmdlib.py
44 44
from ganeti import objects
45 45
from ganeti import serializer
46 46
from ganeti import ssconf
47
from ganeti import uidpool
47 48

  
48 49

  
49 50
class LogicalUnit(object):
......
2265 2266
      if self.op.candidate_pool_size < 1:
2266 2267
        raise errors.OpPrereqError("At least one master candidate needed",
2267 2268
                                   errors.ECODE_INVAL)
2269

  
2268 2270
    _CheckBooleanOpField(self.op, "maintain_node_health")
2269 2271

  
2272
    if self.op.uid_pool:
2273
      uidpool.CheckUidPool(self.op.uid_pool)
2274

  
2270 2275
  def ExpandNames(self):
2271 2276
    # FIXME: in the future maybe other cluster params won't require checking on
2272 2277
    # all nodes to be modified.
......
2461 2466
    if self.op.maintain_node_health is not None:
2462 2467
      self.cluster.maintain_node_health = self.op.maintain_node_health
2463 2468

  
2469
    if self.op.uid_pool is not None:
2470
      self.cluster.uid_pool = self.op.uid_pool
2471

  
2464 2472
    self.cfg.Update(self.cluster, feedback_fn)
2465 2473

  
2466 2474

  
......
3719 3727
      "mtime": cluster.mtime,
3720 3728
      "uuid": cluster.uuid,
3721 3729
      "tags": list(cluster.GetTags()),
3730
      "uid_pool": cluster.uid_pool,
3722 3731
      }
3723 3732

  
3724 3733
    return result
b/lib/opcodes.py
306 306
    "nicparams",
307 307
    "candidate_pool_size",
308 308
    "maintain_node_health",
309
    "uid_pool",
309 310
    ]
310 311

  
311 312

  
b/scripts/gnt-cluster
39 39
from ganeti import bootstrap
40 40
from ganeti import ssh
41 41
from ganeti import objects
42
from ganeti import uidpool
42 43

  
43 44

  
44 45
@UsesRPC
......
601 602
          opts.enabled_hypervisors or opts.hvparams or
602 603
          opts.beparams or opts.nicparams or
603 604
          opts.candidate_pool_size is not None or
605
          opts.uid_pool is not None or
604 606
          opts.maintain_node_health is not None):
605 607
    ToStderr("Please give at least one of the parameters.")
606 608
    return 1
......
628 630
  nicparams = opts.nicparams
629 631
  utils.ForceDictType(nicparams, constants.NICS_PARAMETER_TYPES)
630 632

  
633

  
631 634
  mnh = opts.maintain_node_health
632 635

  
636
  uid_pool = opts.uid_pool
637
  if uid_pool is not None:
638
    uid_pool = uidpool.ParseUidPool(uid_pool)
639

  
633 640
  op = opcodes.OpSetClusterParams(vg_name=vg_name,
634 641
                                  enabled_hypervisors=hvlist,
635 642
                                  hvparams=hvparams,
......
637 644
                                  beparams=beparams,
638 645
                                  nicparams=nicparams,
639 646
                                  candidate_pool_size=opts.candidate_pool_size,
640
                                  maintain_node_health=mnh)
647
                                  maintain_node_health=mnh,
648
                                  uid_pool=uid_pool)
641 649
  SubmitOpCode(op, opts=opts)
642 650
  return 0
643 651

  
......
788 796
  'modify': (
789 797
    SetClusterParams, ARGS_NONE,
790 798
    [BACKEND_OPT, CP_SIZE_OPT, ENABLED_HV_OPT, HVLIST_OPT,
791
     NIC_PARAMS_OPT, NOLVM_STORAGE_OPT, VG_NAME_OPT, MAINTAIN_NODE_HEALTH_OPT],
799
     NIC_PARAMS_OPT, NOLVM_STORAGE_OPT, VG_NAME_OPT, MAINTAIN_NODE_HEALTH_OPT,
800
     UIDPOOL_OPT],
792 801
    "[opts...]",
793 802
    "Alters the parameters of the cluster"),
794 803
  "renew-crypto": (

Also available in: Unified diff