]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
ceph-volume: exceptions: create a module for all exceptions
authorAlfredo Deza <adeza@redhat.com>
Fri, 23 Jun 2017 18:39:23 +0000 (14:39 -0400)
committerAlfredo Deza <adeza@redhat.com>
Fri, 4 Aug 2017 14:25:57 +0000 (10:25 -0400)
Signed-off-by: Alfredo Deza <adeza@redhat.com>
src/ceph-volume/ceph_volume/exceptions.py [new file with mode: 0644]

diff --git a/src/ceph-volume/ceph_volume/exceptions.py b/src/ceph-volume/ceph_volume/exceptions.py
new file mode 100644 (file)
index 0000000..eb35bf1
--- /dev/null
@@ -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'