Revision baa7f1d6
b/lib/storage/base.py | ||
---|---|---|
330 | 330 |
ThrowError("Failed to parse blockdev output: %s", str(err)) |
331 | 331 |
return sz |
332 | 332 |
|
333 |
def GetActualSpindles(self): |
|
334 |
"""Return the actual number of spindles used. |
|
335 |
|
|
336 |
This is not supported by all devices; if not supported, C{None} is returned. |
|
337 |
|
|
338 |
@note: the device needs to be active when this is called |
|
339 |
|
|
340 |
""" |
|
341 |
assert self.attached, "BlockDevice not attached in GetActualSpindles()" |
|
342 |
return None |
|
343 |
|
|
344 |
def GetActualDimensions(self): |
|
345 |
"""Return the actual disk size and number of spindles used. |
|
346 |
|
|
347 |
@rtype: tuple |
|
348 |
@return: (size, spindles); spindles is C{None} when they are not supported |
|
349 |
|
|
350 |
@note: the device needs to be active when this is called |
|
351 |
|
|
352 |
""" |
|
353 |
return (self.GetActualSize(), self.GetActualSpindles()) |
|
354 |
|
|
333 | 355 |
def __repr__(self): |
334 | 356 |
return ("<%s: unique_id: %s, children: %s, %s:%s, %s>" % |
335 | 357 |
(self.__class__, self.unique_id, self._children, |
b/lib/storage/bdev.py | ||
---|---|---|
746 | 746 |
return |
747 | 747 |
base.ThrowError("Can't grow LV %s: %s", self.dev_path, result.output) |
748 | 748 |
|
749 |
def GetActualSpindles(self): |
|
750 |
"""Return the number of spindles used. |
|
751 |
|
|
752 |
""" |
|
753 |
assert self.attached, "BlockDevice not attached in GetActualSpindles()" |
|
754 |
return len(self.pv_names) |
|
755 |
|
|
749 | 756 |
|
750 | 757 |
class FileStorage(base.BlockDev): |
751 | 758 |
"""File device. |
Also available in: Unified diff