Fixed filtering if largest disk selection
This commit is contained in:
parent
81e52bc3ff
commit
1814a19d6a
|
|
@ -87,7 +87,7 @@ def select_largest_device(devices, gigabytes, filter_out=None):
|
||||||
if not len(copy_devices):
|
if not len(copy_devices):
|
||||||
return None
|
return None
|
||||||
|
|
||||||
return max(copy_devices, key=(lambda device : abs(device.size - gigabytes)))
|
return max(copy_devices, key=(lambda device : device.size if device.size > gigabytes else 0))
|
||||||
|
|
||||||
def select_disk_larger_than_or_close_to(devices, gigabytes, filter_out=None):
|
def select_disk_larger_than_or_close_to(devices, gigabytes, filter_out=None):
|
||||||
if not filter_out:
|
if not filter_out:
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue