From dff46583d354ced83a056d404abc70fd3ac92de3 Mon Sep 17 00:00:00 2001 From: Russell Haering Date: Wed, 4 Jun 2014 10:44:25 -0700 Subject: Add a HardwareManager method to erase devices Add erase_devices method to the HardwareManager class. By default this method iterates block devices, and calls a new abstract erase_block_device method for each device. This patch includes a simple implementation of erase_block_device on the GenericHardwareManager which attempts to issue an ATA secure erase on supported devices. Change-Id: I81da065395b8785f636f1b0a0d60c9f1c045441e --- ironic_python_agent/errors.py | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'ironic_python_agent/errors.py') diff --git a/ironic_python_agent/errors.py b/ironic_python_agent/errors.py index 0d86ebac..61d17b3b 100644 --- a/ironic_python_agent/errors.py +++ b/ironic_python_agent/errors.py @@ -184,5 +184,15 @@ class SystemRebootError(RESTError): self.details = self.details.format(exit_code) +class BlockDeviceEraseError(RESTError): + """Error raised when an error occurs erasing a block device.""" + + message = 'Error erasing block device' + + def __init__(self, details): + super(BlockDeviceEraseError, self).__init__(details) + self.details = details + + class ExtensionError(Exception): pass -- cgit v1.2.1