parms->params Refactoring
authorManuel Franceschini <manuel.franceschini@gmail.com>
Mon, 31 Mar 2008 12:04:01 +0000 (12:04 +0000)
committerManuel Franceschini <manuel.franceschini@gmail.com>
Mon, 31 Mar 2008 12:04:01 +0000 (12:04 +0000)
- Substitute all occurences of name 'parms' with 'params'
- Small codestyle fix

Reviewed-by: ultrotter

lib/cmdlib.py
lib/mcpu.py
lib/opcodes.py
scripts/gnt-instance

index 0bbc11a..13138a5 100644 (file)
@@ -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:
index 8022829..06a1a8e 100644 (file)
@@ -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
index e079e59..37350e2 100644 (file)
@@ -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",
index 8963456..335d650 100755 (executable)
@@ -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",