Revision abe609b2 lib/cmdlib.py
b/lib/cmdlib.py | ||
---|---|---|
1489 | 1489 |
# validate beparams changes |
1490 | 1490 |
if self.op.beparams: |
1491 | 1491 |
utils.ForceDictType(self.op.beparams, constants.BES_PARAMETER_TYPES) |
1492 |
self.new_beparams = cluster.FillDict(
|
|
1492 |
self.new_beparams = objects.FillDict(
|
|
1493 | 1493 |
cluster.beparams[constants.BEGR_DEFAULT], self.op.beparams) |
1494 | 1494 |
|
1495 | 1495 |
# hypervisor list/parameters |
1496 |
self.new_hvparams = cluster.FillDict(cluster.hvparams, {})
|
|
1496 |
self.new_hvparams = objects.FillDict(cluster.hvparams, {})
|
|
1497 | 1497 |
if self.op.hvparams: |
1498 | 1498 |
if not isinstance(self.op.hvparams, dict): |
1499 | 1499 |
raise errors.OpPrereqError("Invalid 'hvparams' parameter on input") |
... | ... | |
2848 | 2848 |
# check hypervisor parameter syntax (locally) |
2849 | 2849 |
cluster = self.cfg.GetClusterInfo() |
2850 | 2850 |
utils.ForceDictType(self.hvparams, constants.HVS_PARAMETER_TYPES) |
2851 |
filled_hvp = cluster.FillDict(cluster.hvparams[instance.hypervisor],
|
|
2851 |
filled_hvp = objects.FillDict(cluster.hvparams[instance.hypervisor],
|
|
2852 | 2852 |
instance.hvparams) |
2853 | 2853 |
filled_hvp.update(self.hvparams) |
2854 | 2854 |
hv_type = hypervisor.GetHypervisor(instance.hypervisor) |
... | ... | |
4404 | 4404 |
|
4405 | 4405 |
# check hypervisor parameter syntax (locally) |
4406 | 4406 |
utils.ForceDictType(self.op.hvparams, constants.HVS_PARAMETER_TYPES) |
4407 |
filled_hvp = cluster.FillDict(cluster.hvparams[self.op.hypervisor],
|
|
4407 |
filled_hvp = objects.FillDict(cluster.hvparams[self.op.hypervisor],
|
|
4408 | 4408 |
self.op.hvparams) |
4409 | 4409 |
hv_type = hypervisor.GetHypervisor(self.op.hypervisor) |
4410 | 4410 |
hv_type.CheckParameterSyntax(filled_hvp) |
4411 | 4411 |
|
4412 | 4412 |
# fill and remember the beparams dict |
4413 | 4413 |
utils.ForceDictType(self.op.beparams, constants.BES_PARAMETER_TYPES) |
4414 |
self.be_full = cluster.FillDict(cluster.beparams[constants.BEGR_DEFAULT],
|
|
4414 |
self.be_full = objects.FillDict(cluster.beparams[constants.BEGR_DEFAULT],
|
|
4415 | 4415 |
self.op.beparams) |
4416 | 4416 |
|
4417 | 4417 |
#### instance parameters check |
... | ... | |
5963 | 5963 |
i_hvdict[key] = val |
5964 | 5964 |
cluster = self.cfg.GetClusterInfo() |
5965 | 5965 |
utils.ForceDictType(i_hvdict, constants.HVS_PARAMETER_TYPES) |
5966 |
hv_new = cluster.FillDict(cluster.hvparams[instance.hypervisor],
|
|
5966 |
hv_new = objects.FillDict(cluster.hvparams[instance.hypervisor],
|
|
5967 | 5967 |
i_hvdict) |
5968 | 5968 |
# local check |
5969 | 5969 |
hypervisor.GetHypervisor( |
... | ... | |
5987 | 5987 |
i_bedict[key] = val |
5988 | 5988 |
cluster = self.cfg.GetClusterInfo() |
5989 | 5989 |
utils.ForceDictType(i_bedict, constants.BES_PARAMETER_TYPES) |
5990 |
be_new = cluster.FillDict(cluster.beparams[constants.BEGR_DEFAULT],
|
|
5990 |
be_new = objects.FillDict(cluster.beparams[constants.BEGR_DEFAULT],
|
|
5991 | 5991 |
i_bedict) |
5992 | 5992 |
self.be_new = be_new # the new actual values |
5993 | 5993 |
self.be_inst = i_bedict # the new dict (without defaults) |
Also available in: Unified diff