Revision 703f9a66 lib/cmdlib/instance_operation.py
b/lib/cmdlib/instance_operation.py | ||
---|---|---|
41 | 41 |
from ganeti.cmdlib.instance_storage import StartInstanceDisks, \ |
42 | 42 |
ShutdownInstanceDisks, ImageDisks |
43 | 43 |
from ganeti.cmdlib.instance_utils import BuildInstanceHookEnvByObject, \ |
44 |
CheckInstanceBridgesExist, CheckNodeFreeMemory, CheckNodeHasOS
|
|
44 |
CheckInstanceBridgesExist, CheckNodeFreeMemory |
|
45 | 45 |
from ganeti.hypervisor import hv_base |
46 | 46 |
|
47 | 47 |
|
... | ... | |
302 | 302 |
|
303 | 303 |
def _MergeValidateOsParams(self, instance): |
304 | 304 |
"Handle the OS parameter merging and validation for the target instance." |
305 |
|
|
306 |
if self.op.os_type is not None: |
|
307 |
# OS verification |
|
308 |
CheckNodeHasOS(self, instance.primary_node, self.op.os_type, |
|
309 |
self.op.force_variant) |
|
310 |
instance_os = self.op.os_type |
|
311 |
else: |
|
312 |
instance_os = instance.os |
|
313 |
|
|
314 | 305 |
node_uuids = list(instance.all_nodes) |
315 | 306 |
|
316 | 307 |
self.op.osparams = self.op.osparams or {} |
... | ... | |
323 | 314 |
self.op.osparams_private) |
324 | 315 |
params_secret = self.op.osparams_secret |
325 | 316 |
|
317 |
# Handle OS parameters |
|
318 |
if self.op.os_type is not None: |
|
319 |
instance_os = self.op.os_type |
|
320 |
else: |
|
321 |
instance_os = instance.os |
|
322 |
|
|
326 | 323 |
cluster = self.cfg.GetClusterInfo() |
327 | 324 |
self.osparams = cluster.SimpleFillOS( |
328 | 325 |
instance_os, |
Also available in: Unified diff