Revision acd9ff9e lib/cmdlib.py
b/lib/cmdlib.py | ||
---|---|---|
6091 | 6091 |
info.Raise("Hypervisor parameter validation failed on node %s" % node) |
6092 | 6092 |
|
6093 | 6093 |
|
6094 |
def _CheckOSParams(lu, required, nodenames, osname, osparams): |
|
6095 |
"""OS parameters validation. |
|
6096 |
|
|
6097 |
@type lu: L{LogicalUnit} |
|
6098 |
@param lu: the logical unit for which we check |
|
6099 |
@type required: boolean |
|
6100 |
@param required: whether the validation should fail if the OS is not |
|
6101 |
found |
|
6102 |
@type nodenames: list |
|
6103 |
@param nodenames: the list of nodes on which we should check |
|
6104 |
@type osname: string |
|
6105 |
@param osname: the name of the hypervisor we should use |
|
6106 |
@type osparams: dict |
|
6107 |
@param osparams: the parameters which we need to check |
|
6108 |
@raise errors.OpPrereqError: if the parameters are not valid |
|
6109 |
|
|
6110 |
""" |
|
6111 |
result = lu.rpc.call_os_validate(required, nodenames, osname, |
|
6112 |
[constants.OS_VALIDATE_PARAMETERS], |
|
6113 |
osparams) |
|
6114 |
for node, nres in result.items(): |
|
6115 |
# we don't check for offline cases since this should be run only |
|
6116 |
# against the master node and/or an instance's nodes |
|
6117 |
nres.Raise("OS Parameters validation failed on node %s" % node) |
|
6118 |
if not nres.payload: |
|
6119 |
lu.LogInfo("OS %s not found on node %s, validation skipped", |
|
6120 |
osname, node) |
|
6121 |
|
|
6122 |
|
|
6094 | 6123 |
class LUCreateInstance(LogicalUnit): |
6095 | 6124 |
"""Create an instance. |
6096 | 6125 |
|
Also available in: Unified diff