mirror of
https://github.com/ceph/ceph
synced 2025-03-07 00:40:00 +00:00
ceph-volume: systemd: move the exceptions to the new exception module
Signed-off-by: Alfredo Deza <adeza@redhat.com>
This commit is contained in:
parent
545f3f1e7e
commit
2bf2758a14
@ -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,
|
||||
|
@ -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:
|
||||
|
Loading…
Reference in New Issue
Block a user