]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
ceph-volume: systemd: move the exceptions to the new exception module
authorAlfredo Deza <adeza@redhat.com>
Fri, 23 Jun 2017 18:39:07 +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/main.py
src/ceph-volume/ceph_volume/systemd.py

index 5764c904ab1fc568fbf66a4ebe5be951d5b443c2..25d8b9acae1074cd767e26ffcadb5fe7d86a13d7 100644 (file)
@@ -72,6 +72,7 @@ Log Path: {log_path}
 
     @catches()
     def main(self, argv):
+        # XXX Port the CLI args to user arparse
         options = [['--log', '--logging']]
         parser = Transport(argv, mapper=self.mapper,
                            options=options, check_help=False,
index 18606840d2309151ff9adf64bc8348b3f7e375ea..a904d97cd73319983b7358329c555817af0e9720 100644 (file)
@@ -6,24 +6,14 @@ as arguments to this script so that it can parse the suffix into arguments that
 
 import sys
 import logging
-from ceph_volume import log
-from ceph_volume import process
+from ceph_volume import log, process
+from ceph_volume.exceptions import SuffixParsingError
+
 
 log.setup(name='ceph-volume-systemd.log')
 logger = logging.getLogger('systemd')
 
 
-class SuffixParsingError(SystemExit):
-
-    def __init__(self, suffix, part=None):
-        self.suffix = suffix
-        self.part = part
-        SystemExit.__init__(self, self.__str__())
-
-    def __str__(self):
-        return 'Unable to parse the %s from systemd suffix: %s' % (self.part, self.suffix)
-
-
 def parse_subcommand(string):
     subcommand = string.rsplit('-', 1)[-1]
     if not subcommand: