"SYNC_OPT",
"TAG_SRC_OPT",
"TIMEOUT_OPT",
+ "UIDPOOL_OPT",
"USEUNITS_OPT",
"USE_REPL_NET_OPT",
"VERBOSE_OPT",
" the current cluster defaults and set them as such, instead"
" of marking them as overridden")
+UIDPOOL_OPT = cli_option("--uid-pool", default=None,
+ action="store", dest="uid_pool",
+ help=("A list of user-ids or user-id"
+ " ranges separated by commas"))
+
def _ParseArgs(argv, commands, aliases):
"""Parser for the command line arguments.
from ganeti import objects
from ganeti import serializer
from ganeti import ssconf
+from ganeti import uidpool
class LogicalUnit(object):
if self.op.candidate_pool_size < 1:
raise errors.OpPrereqError("At least one master candidate needed",
errors.ECODE_INVAL)
+
_CheckBooleanOpField(self.op, "maintain_node_health")
+ if self.op.uid_pool:
+ uidpool.CheckUidPool(self.op.uid_pool)
+
def ExpandNames(self):
# FIXME: in the future maybe other cluster params won't require checking on
# all nodes to be modified.
if self.op.maintain_node_health is not None:
self.cluster.maintain_node_health = self.op.maintain_node_health
+ if self.op.uid_pool is not None:
+ self.cluster.uid_pool = self.op.uid_pool
+
self.cfg.Update(self.cluster, feedback_fn)
"mtime": cluster.mtime,
"uuid": cluster.uuid,
"tags": list(cluster.GetTags()),
+ "uid_pool": cluster.uid_pool,
}
return result
from ganeti import bootstrap
from ganeti import ssh
from ganeti import objects
+from ganeti import uidpool
@UsesRPC
opts.enabled_hypervisors or opts.hvparams or
opts.beparams or opts.nicparams or
opts.candidate_pool_size is not None or
+ opts.uid_pool is not None or
opts.maintain_node_health is not None):
ToStderr("Please give at least one of the parameters.")
return 1
nicparams = opts.nicparams
utils.ForceDictType(nicparams, constants.NICS_PARAMETER_TYPES)
+
mnh = opts.maintain_node_health
+ uid_pool = opts.uid_pool
+ if uid_pool is not None:
+ uid_pool = uidpool.ParseUidPool(uid_pool)
+
op = opcodes.OpSetClusterParams(vg_name=vg_name,
enabled_hypervisors=hvlist,
hvparams=hvparams,
beparams=beparams,
nicparams=nicparams,
candidate_pool_size=opts.candidate_pool_size,
- maintain_node_health=mnh)
+ maintain_node_health=mnh,
+ uid_pool=uid_pool)
SubmitOpCode(op, opts=opts)
return 0
'modify': (
SetClusterParams, ARGS_NONE,
[BACKEND_OPT, CP_SIZE_OPT, ENABLED_HV_OPT, HVLIST_OPT,
- NIC_PARAMS_OPT, NOLVM_STORAGE_OPT, VG_NAME_OPT, MAINTAIN_NODE_HEALTH_OPT],
+ NIC_PARAMS_OPT, NOLVM_STORAGE_OPT, VG_NAME_OPT, MAINTAIN_NODE_HEALTH_OPT,
+ UIDPOOL_OPT],
"[opts...]",
"Alters the parameters of the cluster"),
"renew-crypto": (