Revision 3fc175f0

b/lib/cmdlib.py
4270 4270

  
4271 4271
    # hvm_cdrom_image_path verification
4272 4272
    if self.op.hvm_cdrom_image_path is not None:
4273
      if not os.path.isabs(self.op.hvm_cdrom_image_path):
4273
      if not (os.path.isabs(self.op.hvm_cdrom_image_path) or
4274
              self.op.hvm_cdrom_image_path.lower() == "none"):
4274 4275
        raise errors.OpPrereqError("The path to the HVM CDROM image must"
4275 4276
                                   " be an absolute path or None, not %s" %
4276 4277
                                   self.op.hvm_cdrom_image_path)
4277
      if not os.path.isfile(self.op.hvm_cdrom_image_path):
4278
      if not (os.path.isfile(self.op.hvm_cdrom_image_path) or
4279
              self.op.hvm_cdrom_image_path.lower() == "none"):
4278 4280
        raise errors.OpPrereqError("The HVM CDROM image must either be a"
4279 4281
                                   " regular file or a symlink pointing to"
4280 4282
                                   " an existing regular file, not %s" %
......
4326 4328
      else:
4327 4329
        instance.hvm_boot_order = self.hvm_boot_order
4328 4330
      result.append(("hvm_boot_order", self.hvm_boot_order))
4329
    if self.hvm_acpi:
4331
    if self.hvm_acpi is not None:
4330 4332
      instance.hvm_acpi = self.hvm_acpi
4331 4333
      result.append(("hvm_acpi", self.hvm_acpi))
4332
    if self.hvm_pae:
4334
    if self.hvm_pae is not None:
4333 4335
      instance.hvm_pae = self.hvm_pae
4334 4336
      result.append(("hvm_pae", self.hvm_pae))
4335 4337
    if self.hvm_cdrom_image_path:
4336
      instance.hvm_cdrom_image_path = self.hvm_cdrom_image_path
4338
      if self.hvm_cdrom_image_path == constants.VALUE_NONE:
4339
        instance.hvm_cdrom_image_path = None
4340
      else:
4341
        instance.hvm_cdrom_image_path = self.hvm_cdrom_image_path
4337 4342
      result.append(("hvm_cdrom_image_path", self.hvm_cdrom_image_path))
4338 4343
    if self.vnc_bind_address:
4339 4344
      instance.vnc_bind_address = self.vnc_bind_address
b/scripts/gnt-instance
729 729
  else:
730 730
    hvm_boot_order = opts.hvm_boot_order
731 731

  
732
  hvm_acpi = opts.hvm_acpi == _VALUE_TRUE
733
  hvm_pae = opts.hvm_pae == _VALUE_TRUE
732
  if opts.hvm_acpi is None:
733
    hvm_acpi = opts.hvm_acpi
734
  else:
735
    hvm_acpi = opts.hvm_acpi == _VALUE_TRUE
734 736

  
735
  if ((opts.hvm_cdrom_image_path is not None) and
736
      (opts.hvm_cdrom_image_path.lower() == constants.VALUE_NONE)):
737
    hvm_cdrom_image_path = None
737
  if opts.hvm_pae is None:
738
    hvm_pae = opts.hvm_pae
738 739
  else:
739
    hvm_cdrom_image_path = opts.hvm_cdrom_image_path
740
    hvm_pae = opts.hvm_pae == _VALUE_TRUE
740 741

  
741 742
  op = opcodes.OpSetInstanceParams(instance_name=args[0], mem=opts.mem,
742 743
                                   vcpus=opts.vcpus, ip=opts.ip,
......
745 746
                                   initrd_path=opts.initrd_path,
746 747
                                   hvm_boot_order=hvm_boot_order,
747 748
                                   hvm_acpi=hvm_acpi, hvm_pae=hvm_pae,
748
                                   hvm_cdrom_image_path=hvm_cdrom_image_path,
749
                                   hvm_cdrom_image_path=
750
                                   opts.hvm_cdrom_image_path,
749 751
                                   vnc_bind_address=opts.vnc_bind_address)
750 752

  
751 753
  result = SubmitOpCode(op)

Also available in: Unified diff