From b035bb0f54d4a7777ce242798bdeb18ad0dc28e0 Mon Sep 17 00:00:00 2001 From: Alfredo Deza Date: Tue, 22 May 2018 12:57:19 -0400 Subject: [PATCH] ceph-volume exceptions create an error for size allocations Signed-off-by: Alfredo Deza --- src/ceph-volume/ceph_volume/exceptions.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/ceph-volume/ceph_volume/exceptions.py b/src/ceph-volume/ceph_volume/exceptions.py index 211d9d09b9e04..f40b7b11d37a9 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 -- 2.39.5