summaryrefslogtreecommitdiff
path: root/nova/virt/images.py
diff options
context:
space:
mode:
authorMatthew Booth <mbooth@redhat.com>2015-07-24 14:34:43 +0100
committerMatthew Booth <mbooth@redhat.com>2015-08-19 12:54:56 -0700
commit30e73e001d49e5646a3fbc07e676361212b67b1d (patch)
tree80ff5bae57eb386073dfb7f6da0bc64929d8d446 /nova/virt/images.py
parent9e27fc1f47c0f1e5b0bdecd29166d59c72d9e903 (diff)
downloadnova-30e73e001d49e5646a3fbc07e676361212b67b1d.tar.gz
compute: improve exceptions related to disk size checks
Having read several user reports of FlavorDiskTooSmall, it is apparent that this error is not meaningful to users. We create 3 new subclasses of FlavorDiskTooSmall: FlavorDiskSmallerThanImage, FlavorDiskSmallerThanMinDisk, and VolumeSmallerThanMinDisk, because these exceptions require different actions by the user. The new subclasses get a more detailed error message to help the user. Change-Id: I2234c4f4f9b5ac0780b3ec2e6a168380c07ed8c1
Diffstat (limited to 'nova/virt/images.py')
-rw-r--r--nova/virt/images.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/nova/virt/images.py b/nova/virt/images.py
index c8f1b6c254..5b9374b682 100644
--- a/nova/virt/images.py
+++ b/nova/virt/images.py
@@ -116,7 +116,8 @@ def fetch_to_raw(context, image_href, path, user_id, project_id, max_size=0):
{'base': path,
'disk_size': disk_size,
'size': max_size})
- raise exception.FlavorDiskTooSmall()
+ raise exception.FlavorDiskSmallerThanImage(
+ flavor_size=max_size, image_size=disk_size)
if fmt != "raw" and CONF.force_raw_images:
staged = "%s.converted" % path