From: Alfredo Deza Date: Mon, 28 Aug 2017 21:33:39 +0000 (-0400) Subject: ceph-volume exceptions create a specifc error for multiple pvs X-Git-Tag: v12.2.1~94^2~10 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=7da501a250fb551edb396dde1f19d9737a5812c7;p=ceph.git ceph-volume exceptions create a specifc error for multiple pvs Signed-off-by: Alfredo Deza (cherry picked from commit 73315c49115dbb45f3bb6c9e46955b333602cec2) --- diff --git a/src/ceph-volume/ceph_volume/exceptions.py b/src/ceph-volume/ceph_volume/exceptions.py index 75c6b6c6405..211d9d09b9e 100644 --- a/src/ceph-volume/ceph_volume/exceptions.py +++ b/src/ceph-volume/ceph_volume/exceptions.py @@ -50,6 +50,16 @@ class SuperUserError(Exception): return 'This command needs to be executed with sudo or as root' +class MultiplePVsError(Exception): + + def __init__(self, pv_name): + self.pv_name = pv_name + + def __str__(self): + msg = "Got more than 1 result looking for physical volume: %s" % self.pv_name + return msg + + class MultipleLVsError(Exception): def __init__(self, lv_name, lv_path):