Commit 7767bbf5 authored by Manuel Franceschini's avatar Manuel Franceschini
Browse files

parms->params Refactoring

- Substitute all occurences of name 'parms' with 'params'
- Small codestyle fix

Reviewed-by: ultrotter
parent 90b6aa3a
......@@ -1042,7 +1042,6 @@ class LUSetClusterParams(LogicalUnit):
if the given volume group is valid.
"""
if not self.op.vg_name:
instances = [self.cfg.GetInstanceInfo(name)
for name in self.cfg.GetInstanceList()]
......@@ -3907,7 +3906,7 @@ class LUQueryInstanceData(NoHooksLU):
return result
class LUSetInstanceParms(LogicalUnit):
class LUSetInstanceParams(LogicalUnit):
"""Modifies an instances's parameters.
"""
......@@ -3959,9 +3958,9 @@ class LUSetInstanceParms(LogicalUnit):
self.kernel_path = getattr(self.op, "kernel_path", None)
self.initrd_path = getattr(self.op, "initrd_path", None)
self.hvm_boot_order = getattr(self.op, "hvm_boot_order", None)
all_parms = [self.mem, self.vcpus, self.ip, self.bridge, self.mac,
self.kernel_path, self.initrd_path, self.hvm_boot_order]
if all_parms.count(None) == len(all_parms):
all_params = [self.mem, self.vcpus, self.ip, self.bridge, self.mac,
self.kernel_path, self.initrd_path, self.hvm_boot_order]
if all_params.count(None) == len(all_params):
raise errors.OpPrereqError("No changes submitted")
if self.mem is not None:
try:
......
......@@ -74,7 +74,7 @@ class Processor(object):
opcodes.OpConnectConsole: cmdlib.LUConnectConsole,
opcodes.OpQueryInstances: cmdlib.LUQueryInstances,
opcodes.OpQueryInstanceData: cmdlib.LUQueryInstanceData,
opcodes.OpSetInstanceParms: cmdlib.LUSetInstanceParms,
opcodes.OpSetInstanceParams: cmdlib.LUSetInstanceParams,
# os lu
opcodes.OpDiagnoseOS: cmdlib.LUDiagnoseOS,
# exports lu
......
......@@ -349,9 +349,9 @@ class OpQueryInstanceData(OpCode):
__slots__ = ["instances"]
class OpSetInstanceParms(OpCode):
class OpSetInstanceParams(OpCode):
"""Change the parameters of an instance."""
OP_ID = "OP_INSTANCE_SET_PARMS"
OP_ID = "OP_INSTANCE_SET_PARAMS"
__slots__ = [
"instance_name", "mem", "vcpus", "ip", "bridge", "mac",
"kernel_path", "initrd_path", "hvm_boot_order",
......
......@@ -635,7 +635,7 @@ def ShowInstanceConfig(opts, args):
return retcode
def SetInstanceParms(opts, args):
def SetInstanceParams(opts, args):
"""Modifies an instance.
All parameters take effect only at the next restart of the instance.
......@@ -661,12 +661,12 @@ def SetInstanceParms(opts, args):
else:
hvm_boot_order = opts.hvm_boot_order
op = opcodes.OpSetInstanceParms(instance_name=args[0], mem=opts.mem,
vcpus=opts.vcpus, ip=opts.ip,
bridge=opts.bridge, mac=opts.mac,
kernel_path=opts.kernel_path,
initrd_path=opts.initrd_path,
hvm_boot_order=hvm_boot_order)
op = opcodes.OpSetInstanceParams(instance_name=args[0], mem=opts.mem,
vcpus=opts.vcpus, ip=opts.ip,
bridge=opts.bridge, mac=opts.mac,
kernel_path=opts.kernel_path,
initrd_path=opts.initrd_path,
hvm_boot_order=hvm_boot_order)
result = SubmitOpCode(op)
if result:
......@@ -832,7 +832,7 @@ commands = {
],
"[-s|-p|-n NODE] <instance>",
"Replaces all disks for the instance"),
'modify': (SetInstanceParms, ARGS_ONE,
'modify': (SetInstanceParams, ARGS_ONE,
[DEBUG_OPT, FORCE_OPT,
cli_option("-m", "--memory", dest="mem",
help="Memory size",
......
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