ceph-volume: systemd: move the exceptions to the new exception module

Signed-off-by: Alfredo Deza <adeza@redhat.com>
This commit is contained in:
Alfredo Deza 2017-06-23 14:39:07 -04:00
parent 545f3f1e7e
commit 2bf2758a14
2 changed files with 4 additions and 13 deletions

View 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,

View 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: