Commit 68959ca5 authored by Michael Hanselmann's avatar Michael Hanselmann
Browse files

rpc: Convert call for HV parameter validation

Instead of filling the parameters in the RPC layer, that is now done
before the wrapper is called, thereby simplifying the wrapper.
Signed-off-by: default avatarMichael Hanselmann <>
Reviewed-by: default avatarIustin Pop <>
parent c4de9b7a
......@@ -364,6 +364,10 @@ _MISC_CALLS = [
("test_delay", MULTI, None, [
("duration", None, None),
], None, "Sleep for a fixed time on given node(s)"),
("hypervisor_validate_params", MULTI, TMO_NORMAL, [
("hvname", None, "Hypervisor name"),
("hvfull", None, "Parameters to be validated"),
], None, "Validate hypervisor params"),
......@@ -8223,9 +8223,11 @@ def _CheckHVParams(lu, nodenames, hvname, hvparams):
nodenames = _FilterVmNodes(lu, nodenames)
hvinfo = lu.rpc.call_hypervisor_validate_params(nodenames,
cluster = lu.cfg.GetClusterInfo()
hvfull = objects.FillDict(cluster.hvparams.get(hvname, {}), hvparams)
hvinfo = lu.rpc.call_hypervisor_validate_params(nodenames, hvname, hvfull)
for node in nodenames:
info = hvinfo[node]
if info.offline:
......@@ -691,25 +691,6 @@ class RpcRunner(_generated_rpc.RpcClientDefault,
return self.call_test_delay(node_list, duration,
read_timeout=int(duration + 5))
def call_hypervisor_validate_params(self, node_list, hvname, hvparams):
"""Validate the hypervisor params.
This is a multi-node call.
@type node_list: list
@param node_list: the list of nodes to query
@type hvname: string
@param hvname: the hypervisor name
@type hvparams: dict
@param hvparams: the hypervisor parameters to be validated
cluster = self._cfg.GetClusterInfo()
hv_full = objects.FillDict(cluster.hvparams.get(hvname, {}), hvparams)
return self._MultiNodeCall(node_list, "hypervisor_validate_params",
[hvname, hv_full])
class JobQueueRunner(_generated_rpc.RpcClientJobQueue):
"""RPC wrappers for job queue.
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