From: Alfredo Deza Date: Fri, 23 Jun 2017 18:39:07 +0000 (-0400) Subject: ceph-volume: systemd: move the exceptions to the new exception module X-Git-Tag: v12.1.3~102^2~89 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=2bf2758a14eae67532abc6db2ab9066c17418411;p=ceph-ci.git ceph-volume: systemd: move the exceptions to the new exception module Signed-off-by: Alfredo Deza --- diff --git a/src/ceph-volume/ceph_volume/main.py b/src/ceph-volume/ceph_volume/main.py index 5764c904ab1..25d8b9acae1 100644 --- a/src/ceph-volume/ceph_volume/main.py +++ b/src/ceph-volume/ceph_volume/main.py @@ -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, diff --git a/src/ceph-volume/ceph_volume/systemd.py b/src/ceph-volume/ceph_volume/systemd.py index 18606840d23..a904d97cd73 100644 --- a/src/ceph-volume/ceph_volume/systemd.py +++ b/src/ceph-volume/ceph_volume/systemd.py @@ -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: