Commit bca2e7f4 authored by Iustin Pop's avatar Iustin Pop
Browse files

cleanup: fix backend._RecursiveFindBD

_RecursiveFindBD takes a parameter that isn't used; moreover, nowhere in
the SVN history can I find a case that it has been used.

As such, remove this parameter and fix its callers.

Reviewed-by: amishchenko
parent 9a4e6f41
...@@ -977,9 +977,7 @@ def RemoveBlockDevice(disk): ...@@ -977,9 +977,7 @@ def RemoveBlockDevice(disk):
""" """
try: try:
# since we are removing the device, allow a partial match rdev = _RecursiveFindBD(disk)
# this allows removal of broken mirrors
rdev = _RecursiveFindBD(disk, allow_partial=True)
except errors.BlockDeviceError, err: except errors.BlockDeviceError, err:
# probably can't attach # probably can't attach
logging.info("Can't attach to device %s in remove", disk) logging.info("Can't attach to device %s in remove", disk)
...@@ -1109,7 +1107,7 @@ def MirrorAddChildren(parent_cdev, new_cdevs): ...@@ -1109,7 +1107,7 @@ def MirrorAddChildren(parent_cdev, new_cdevs):
@return: the success of the operation @return: the success of the operation
""" """
parent_bdev = _RecursiveFindBD(parent_cdev, allow_partial=True) parent_bdev = _RecursiveFindBD(parent_cdev)
if parent_bdev is None: if parent_bdev is None:
logging.error("Can't find parent device") logging.error("Can't find parent device")
return False return False
...@@ -1176,17 +1174,13 @@ def GetMirrorStatus(disks): ...@@ -1176,17 +1174,13 @@ def GetMirrorStatus(disks):
return stats return stats
def _RecursiveFindBD(disk, allow_partial=False): def _RecursiveFindBD(disk):
"""Check if a device is activated. """Check if a device is activated.
If so, return informations about the real device. If so, return informations about the real device.
@type disk: L{objects.Disk} @type disk: L{objects.Disk}
@param disk: the disk object we need to find @param disk: the disk object we need to find
@type allow_partial: boolean
@param allow_partial: if true, don't abort the find if a
child of the device can't be found; this is intended
to be used when repairing mirrors
@return: None if the device can't be found, @return: None if the device can't be found,
otherwise the device instance otherwise the device instance
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment