From: Alfredo Deza Date: Tue, 22 May 2018 16:57:19 +0000 (-0400) Subject: ceph-volume exceptions create an error for size allocations X-Git-Tag: v12.2.8~66^2~5 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=0edde30ab3a0c40ee1faa4dd5a22313c94976181;p=ceph.git ceph-volume exceptions create an error for size allocations Signed-off-by: Alfredo Deza (cherry picked from commit b035bb0f54d4a7777ce242798bdeb18ad0dc28e0) --- diff --git a/src/ceph-volume/ceph_volume/exceptions.py b/src/ceph-volume/ceph_volume/exceptions.py index 211d9d09b9e0..f40b7b11d37a 100644 --- a/src/ceph-volume/ceph_volume/exceptions.py +++ b/src/ceph-volume/ceph_volume/exceptions.py @@ -79,3 +79,16 @@ class MultipleVGsError(Exception): def __str__(self): msg = "Got more than 1 result looking for volume group: %s" % self.vg_name return msg + + +class SizeAllocationError(Exception): + + def __init__(self, requested, available): + self.requested = requested + self.available = available + + def __str__(self): + msg = 'Unable to allocate size (%s), not enough free space (%s)' % ( + self.requested, self.available + ) + return msg