From 81ab246d3dc3db776779f22522a9702ab1a19b01 Mon Sep 17 00:00:00 2001 From: Russell Haering Date: Tue, 28 Jan 2014 15:54:24 -0800 Subject: [PATCH] add new ConfigDriveWriteError class --- teeth_agent/errors.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/teeth_agent/errors.py b/teeth_agent/errors.py index e4266dfd9..0e1abf1dd 100644 --- a/teeth_agent/errors.py +++ b/teeth_agent/errors.py @@ -103,6 +103,20 @@ class ImageWriteError(errors.RESTError): self.details = self.details.format(device, exit_code) +class ConfigDriveWriteError(errors.RESTError): + """Error raised when a configdrive directory cannot be written to a + device. + """ + + message = 'Error writing configdrive to device.' + + def __init__(self, exit_code, device): + details = 'Writing configdrive to device {} failed with exit code {}.' + details = details.format(device, exit_code) + super(ConfigDriveWriteError, self).__init__(details) + self.details = details + + class SystemRebootError(errors.RESTError): """Error raised when a system cannot reboot."""