From: Alfredo Deza Date: Fri, 23 Jun 2017 18:39:23 +0000 (-0400) Subject: ceph-volume: exceptions: create a module for all exceptions X-Git-Tag: ses5-milestone10~3^2~5^2~88 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=90ce30ec67819cc8d014648adaacb94339cb0be2;p=ceph.git ceph-volume: exceptions: create a module for all exceptions Signed-off-by: Alfredo Deza --- diff --git a/src/ceph-volume/ceph_volume/exceptions.py b/src/ceph-volume/ceph_volume/exceptions.py new file mode 100644 index 000000000000..eb35bf1bdf5a --- /dev/null +++ b/src/ceph-volume/ceph_volume/exceptions.py @@ -0,0 +1,16 @@ + + +class SuffixParsingError(Exception): + + def __init__(self, suffix, part=None): + self.suffix = suffix + self.part = part + + def __str__(self): + return 'Unable to parse the %s from systemd suffix: %s' % (self.part, self.suffix) + + +class SuperUserError(Exception): + + def __str__(self): + return 'This command needs to be executed with sudo or as root'