]>
git.proxmox.com Git - ceph.git/blob - ceph/src/ceph-volume/ceph_volume/exceptions.py
4 class ConfigurationError(Exception):
6 def __init__(self
, cluster_name
='ceph', path
='/etc/ceph', abspath
=None):
7 self
.cluster_name
= cluster_name
9 self
.abspath
= abspath
or "%s.conf" % os
.path
.join(self
.path
, self
.cluster_name
)
12 return 'Unable to load expected Ceph config at: %s' % self
.abspath
15 class ConfigurationSectionError(Exception):
17 def __init__(self
, section
):
18 self
.section
= section
21 return 'Unable to find expected configuration section: "%s"' % self
.section
24 class ConfigurationKeyError(Exception):
26 def __init__(self
, section
, key
):
27 self
.section
= section
31 return 'Unable to find expected configuration key: "%s" from section "%s"' % (
37 class SuffixParsingError(Exception):
39 def __init__(self
, suffix
, part
=None):
44 return 'Unable to parse the %s from systemd suffix: %s' % (self
.part
, self
.suffix
)
47 class SuperUserError(Exception):
50 return 'This command needs to be executed with sudo or as root'
53 class SizeAllocationError(Exception):
55 def __init__(self
, requested
, available
):
56 self
.requested
= requested
57 self
.available
= available
60 msg
= 'Unable to allocate size (%s), not enough free space (%s)' % (
61 self
.requested
, self
.available