mdadm logging done, some value errors converted to type errors

This commit is contained in:
2019-12-24 01:56:29 -05:00
parent a0442df77d
commit 25e86e75ff
9 changed files with 150 additions and 73 deletions

View File

@@ -28,7 +28,7 @@ class LV(object):
self.pvs = []
if not isinstance(self.vg, VG):
_logger.debug('vgobj must be of type aif.disk.lvm.VG')
raise ValueError('Invalid vgobj type')
raise TypeError('Invalid vgobj type')
_common.addBDPlugin('lvm')
self.info = None
self.devpath = '/dev/{0}/{1}'.format(self.vg.name, self.name)
@@ -150,7 +150,7 @@ class PV(object):
'aif.disk.block.Partition, '
'aif.disk.luks.LUKS, or'
'aif.disk.mdadm.Array.'))
raise ValueError('Invalid partobj type')
raise TypeError('Invalid partobj type')
_common.addBDPlugin('lvm')
self.devpath = self.device.devpath
self.is_pooled = False
@@ -263,7 +263,7 @@ class VG(object):
def addPV(self, pvobj):
if not isinstance(pvobj, PV):
_logger.error('pvobj must be of type aif.disk.lvm.PV.')
raise ValueError('Invalid pvbobj type')
raise TypeError('Invalid pvbobj type')
pvobj.prepare()
self.pvs.append(pvobj)
return(None)