Commit d4b72030 authored by Guido Trotter's avatar Guido Trotter
Browse files

Use the new utils.CheckBEParams function

Where we used/forgot to validate beparams we now use the new common function.

Reviewed-by: imsnah
parent 42ce2e13
......@@ -177,6 +177,8 @@ def InitCluster(cluster_name, mac_prefix, def_bridge,
raise errors.OpPrereqError("Init.d script '%s' missing or not"
" executable." % constants.NODE_INITD_SCRIPT)
# set up the inter-node password and certificate
......@@ -1279,9 +1279,9 @@ class LUSetClusterParams(LogicalUnit):
(node, vgstatus))
self.cluster = cluster = self.cfg.GetClusterInfo()
# beparams changes do not need validation (we can't validate?),
# but we still process here
# validate beparams changes
if self.op.beparams:
self.new_beparams = cluster.FillDict(
cluster.beparams[constants.BEGR_DEFAULT], self.op.beparams)
......@@ -3560,6 +3560,7 @@ class LUCreateInstance(LogicalUnit):
# fill and remember the beparams dict
self.be_full = cluster.FillDict(cluster.beparams[constants.BEGR_DEFAULT],
......@@ -4874,14 +4875,8 @@ class LUSetInstanceParams(LogicalUnit):
self.op.hvparams or self.op.beparams):
raise errors.OpPrereqError("No changes submitted")
for item in (constants.BE_MEMORY, constants.BE_VCPUS):
val = self.op.beparams.get(item, None)
if val is not None:
val = int(val)
except ValueError, err:
raise errors.OpPrereqError("Invalid %s size: %s" % (item, str(err)))
self.op.beparams[item] = val
# Disk validation
disk_addremove = 0
for disk_op, disk_dict in self.op.disks:
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment