Revision 625ac113 lib/cmdlib.py
b/lib/cmdlib.py | ||
---|---|---|
2426 | 2426 |
else: |
2427 | 2427 |
self.new_os_hvp[os_name][hv_name].update(hv_dict) |
2428 | 2428 |
|
2429 |
# os parameters |
|
2430 |
self.new_osp = objects.FillDict(cluster.osparams, {}) |
|
2431 |
if self.op.osparams: |
|
2432 |
if not isinstance(self.op.osparams, dict): |
|
2433 |
raise errors.OpPrereqError("Invalid 'osparams' parameter on input", |
|
2434 |
errors.ECODE_INVAL) |
|
2435 |
for os_name, osp in self.op.osparams.items(): |
|
2436 |
if not isinstance(osp, dict): |
|
2437 |
raise errors.OpPrereqError(("Invalid 'osparams' parameter on" |
|
2438 |
" input"), errors.ECODE_INVAL) |
|
2439 |
if os_name not in self.new_osp: |
|
2440 |
self.new_osp[os_name] = {} |
|
2441 |
|
|
2442 |
self.new_osp[os_name] = _GetUpdatedParams(self.new_osp[os_name], osp, |
|
2443 |
use_none=True) |
|
2444 |
|
|
2445 |
if not self.new_osp[os_name]: |
|
2446 |
# we removed all parameters |
|
2447 |
del self.new_osp[os_name] |
|
2448 |
else: |
|
2449 |
# check the parameter validity (remote check) |
|
2450 |
_CheckOSParams(self, False, [self.cfg.GetMasterNode()], |
|
2451 |
os_name, self.new_osp[os_name]) |
|
2452 |
|
|
2429 | 2453 |
# changes to the hypervisor list |
2430 | 2454 |
if self.op.enabled_hypervisors is not None: |
2431 | 2455 |
self.hv_list = self.op.enabled_hypervisors |
... | ... | |
2502 | 2526 |
self.cluster.beparams[constants.PP_DEFAULT] = self.new_beparams |
2503 | 2527 |
if self.op.nicparams: |
2504 | 2528 |
self.cluster.nicparams[constants.PP_DEFAULT] = self.new_nicparams |
2529 |
if self.op.osparams: |
|
2530 |
self.cluster.osparams = self.new_osp |
|
2505 | 2531 |
|
2506 | 2532 |
if self.op.candidate_pool_size is not None: |
2507 | 2533 |
self.cluster.candidate_pool_size = self.op.candidate_pool_size |
Also available in: Unified diff