From 85ab5a164472f080c0ed15b927bb5081bc509ae3 Mon Sep 17 00:00:00 2001 From: Alfredo Deza Date: Tue, 27 Jun 2017 13:03:11 -0400 Subject: [PATCH] ceph-volume: exceptions: create a MultipleLV error Signed-off-by: Alfredo Deza --- src/ceph-volume/ceph_volume/exceptions.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/ceph-volume/ceph_volume/exceptions.py b/src/ceph-volume/ceph_volume/exceptions.py index eb35bf1bdf5..44739264fb4 100644 --- a/src/ceph-volume/ceph_volume/exceptions.py +++ b/src/ceph-volume/ceph_volume/exceptions.py @@ -14,3 +14,14 @@ class SuperUserError(Exception): def __str__(self): return 'This command needs to be executed with sudo or as root' + + +class MultipleLVsError(Exception): + + def __init__(self, lv_name, lv_path): + self.lv_name = lv_name + self.lv_path = lv_path + + def __str__(self): + msg = "Got more than 1 result looking for %s with path: %s" % (self.lv_name, self.lv_path) + return msg -- 2.39.5