diff options
Diffstat (limited to 'ironic_python_agent/errors.py')
-rw-r--r-- | ironic_python_agent/errors.py | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/ironic_python_agent/errors.py b/ironic_python_agent/errors.py index 1f97c0e2..a0994207 100644 --- a/ironic_python_agent/errors.py +++ b/ironic_python_agent/errors.py @@ -348,3 +348,22 @@ class HeartbeatConnectionError(IronicAPIError): def __init__(self, details): super(HeartbeatConnectionError, self).__init__(details) + + +class ProtectedDeviceError(CleaningError): + """Error raised when a cleaning is halted due to a protected device.""" + + message = 'Protected device located, cleaning aborted.' + + def __init__(self, device, what): + details = ('Protected %(what)s located on device %(device)s. ' + 'This volume or contents may be a shared block device. ' + 'Please consult your storage administrator, and restart ' + 'cleaning after either detaching the volumes, or ' + 'instructing IPA to not protect contents. See Ironic ' + 'Python Agent documentation for more information.' % + {'what': what, + 'device': device}) + + self.message = details + super(CleaningError, self).__init__(details) |