Pass the force param to SetInstanceParms
authorGuido Trotter <ultrotter@google.com>
Mon, 1 Sep 2008 11:37:06 +0000 (11:37 +0000)
committerGuido Trotter <ultrotter@google.com>
Mon, 1 Sep 2008 11:37:06 +0000 (11:37 +0000)
It was already allowed in gnt-instance modify, but ignored.
It will be used to force skipping parameter checks.

This is a forward-port from branches/ganeti-1.2

Original-Reviewed-by: imsnah
Reviewed-by: iustinp

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

index 3fca09f..bf87185 100644 (file)
@@ -4220,6 +4220,7 @@ class LUSetInstanceParams(LogicalUnit):
     self.hvm_disk_type = getattr(self.op, "hvm_disk_type", None)
     self.hvm_cdrom_image_path = getattr(self.op, "hvm_cdrom_image_path", None)
     self.vnc_bind_address = getattr(self.op, "vnc_bind_address", None)
+    self.force = getattr(self.op, "force", None)
     all_parms = [self.mem, self.vcpus, self.ip, self.bridge, self.mac,
                  self.kernel_path, self.initrd_path, self.hvm_boot_order,
                  self.hvm_acpi, self.hvm_pae, self.hvm_cdrom_image_path,
index 3137b8e..2984185 100644 (file)
@@ -400,7 +400,7 @@ class OpSetInstanceParams(OpCode):
     "instance_name", "mem", "vcpus", "ip", "bridge", "mac",
     "kernel_path", "initrd_path", "hvm_boot_order", "hvm_acpi",
     "hvm_pae", "hvm_cdrom_image_path", "vnc_bind_address",
-    "hvm_nic_type", "hvm_disk_type"
+    "hvm_nic_type", "hvm_disk_type", "force"
     ]
 
 
index 1f0dcb1..418f8cc 100755 (executable)
@@ -764,7 +764,8 @@ def SetInstanceParams(opts, args):
                                    opts.hvm_cdrom_image_path,
                                    vnc_bind_address=opts.vnc_bind_address,
                                    hvm_nic_type=hvm_nic_type,
-                                   hvm_disk_type=hvm_disk_type)
+                                   hvm_disk_type=hvm_disk_type,
+                                   force=opts.force)
 
   result = SubmitOpCode(op)