Revision 3fc175f0 lib/cmdlib.py
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 |
Also available in: Unified diff