From 3228cac0d1bc42681e82e90dc92b691af09f0fad Mon Sep 17 00:00:00 2001 From: Rick Harris Date: Mon, 20 May 2013 23:03:48 +0000 Subject: Remove ImageTooLarge exception InstanceTypeDiskTooSmall and ImageTooLarge are really two sides of the same coin; an image is larger than the root_gb of the instance_type. Rather than have two exceptions for this, this patch consolidates down to just InstanceTypeDiskTooSmall. Change-Id: I401205072c111a960beb2932c6c1889141ae03c3 --- nova/virt/libvirt/imagebackend.py | 2 +- nova/virt/xenapi/vm_utils.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'nova/virt') diff --git a/nova/virt/libvirt/imagebackend.py b/nova/virt/libvirt/imagebackend.py index 84686a82a..575ae262e 100755 --- a/nova/virt/libvirt/imagebackend.py +++ b/nova/virt/libvirt/imagebackend.py @@ -258,7 +258,7 @@ class Qcow2(Image): if size and size < disk.get_disk_size(base): LOG.error('%s virtual size larger than flavor root disk size %s' % (base, size)) - raise exception.ImageTooLarge() + raise exception.InstanceTypeDiskTooSmall() if not os.path.exists(self.path): with utils.remove_path_on_error(self.path): copy_qcow2_image(base, self.path, size) diff --git a/nova/virt/xenapi/vm_utils.py b/nova/virt/xenapi/vm_utils.py index 3f2c6835f..69a944b9b 100644 --- a/nova/virt/xenapi/vm_utils.py +++ b/nova/virt/xenapi/vm_utils.py @@ -1207,7 +1207,7 @@ def _check_vdi_size(context, session, instance, vdi_uuid): LOG.info(_("Image size %(size_bytes)d exceeded instance_type " "allowed size %(allowed_size_bytes)d"), locals(), instance=instance) - raise exception.ImageTooLarge() + raise exception.InstanceTypeDiskTooSmall() def _fetch_disk_image(context, session, instance, name_label, image_id, -- cgit