ceph-volume: when all devices are filtered exit gracefully

Even if all devices are filtered we want to return a 0 exit code and
make sure the json reporting still works.

Signed-off-by: Andrew Schoen <aschoen@redhat.com>
This commit is contained in:
Andrew Schoen 2018-10-09 14:05:54 -04:00
parent fc9a10e548
commit aa4fcd602f
2 changed files with 20 additions and 8 deletions

View File

@ -21,8 +21,11 @@ class SingleType(object):
self.hdds = [device for device in devices if device.sys_api['rotational'] == '1']
self.ssds = [device for device in devices if device.sys_api['rotational'] == '0']
self.computed = {'osds': [], 'vgs': [], 'filtered_devices': args.filtered_devices}
self.validate()
self.compute()
if self.devices:
self.validate()
self.compute()
else:
self.computed["changed"] = False
@staticmethod
def type():
@ -147,8 +150,11 @@ class MixedType(object):
self.block_db_size = self.get_block_size()
self.system_vgs = lvm.VolumeGroups()
self.dbs_needed = len(self.hdds) * self.osds_per_device
self.validate()
self.compute()
if self.devices:
self.validate()
self.compute()
else:
self.computed["changed"] = False
@staticmethod
def type():

View File

@ -33,8 +33,11 @@ class SingleType(object):
self.ssds = [device for device in devices if device.sys_api['rotational'] == '0']
self.computed = {'osds': [], 'vgs': [], 'filtered_devices': args.filtered_devices}
self.journal_size = get_journal_size(args)
self.validate()
self.compute()
if self.devices:
self.validate()
self.compute()
else:
self.computed["changed"] = False
@staticmethod
def type():
@ -189,8 +192,11 @@ class MixedType(object):
self.journals_needed = len(self.hdds) * self.osds_per_device
self.journal_size = get_journal_size(args)
self.system_vgs = lvm.VolumeGroups()
self.validate()
self.compute()
if self.devices:
self.validate()
self.compute()
else:
self.computed["changed"] = False
@staticmethod
def type():