mirror of
https://github.com/ceph/ceph
synced 2025-01-31 23:44:10 +00:00
ceph-volume: fix Batch object in py3 environments
Fixes: https://tracker.ceph.com/issues/37356 Signed-off-by: Jan Fajerski <jfajerski@suse.com>
This commit is contained in:
parent
8fe92c3534
commit
851c7693da
@ -139,14 +139,11 @@ class Batch(object):
|
||||
self.argv = argv
|
||||
|
||||
def get_devices(self):
|
||||
all_devices = disk.get_devices()
|
||||
# remove devices with partitions
|
||||
# XXX Should be optional when getting device info
|
||||
for device, detail in all_devices.items():
|
||||
if detail.get('partitions') != {}:
|
||||
del all_devices[device]
|
||||
devices = sorted(all_devices.items(), key=lambda x: (x[0], x[1]['size']))
|
||||
return device_formatter(devices)
|
||||
devices = [(device, details) for device, details in
|
||||
disk.get_devices().items() if details.get('partitions') == {}]
|
||||
size_sort = lambda x: (x[0], x[1]['size'])
|
||||
return device_formatter(sorted(devices, key=size_sort))
|
||||
|
||||
def print_help(self):
|
||||
return self._help.format(
|
||||
|
Loading…
Reference in New Issue
Block a user