From 83782018f73266d52e5c3fab6e82f3d3257fb94d Mon Sep 17 00:00:00 2001 From: Josh Gachnang Date: Fri, 18 Jul 2014 08:13:12 -0700 Subject: Improve Disk Detection The previous implementation of list_block_devices used blockdev, which would list partitions, software RAID and other devices as block devices. By switching to lsblk, the agent can filter down to only physical block devices, which is all the agent cares about for any of its operations. This change adds two new fields to the BlockDevice class: model, a string of the block devices reported model, and rotational, a boolean representing a spinning disk (True) or a solid state disk (False). This data can be useful for vendor hardware managers. Change-Id: I385c3bb378c2c49385bca14a1d7efa074933becf Closes-Bug: 1344351 --- ironic_python_agent/errors.py | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'ironic_python_agent/errors.py') diff --git a/ironic_python_agent/errors.py b/ironic_python_agent/errors.py index be61bdb6..f461aaa1 100644 --- a/ironic_python_agent/errors.py +++ b/ironic_python_agent/errors.py @@ -214,5 +214,14 @@ class BlockDeviceEraseError(RESTError): self.details = details +class BlockDeviceError(RESTError): + """Error raised when a block devices causes an unknown error""" + message = 'Block device caused unknown error' + + def __init__(self, details): + super(BlockDeviceError, self).__init__(details) + self.details = details + + class ExtensionError(Exception): pass -- cgit v1.2.1