def _mkfs_version(self): args = ['/sbin/mkfs.ext4', '-V'] logger.debug("execute: %s" % args) p = subprocess.Popen(args, close_fds=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE) out, err = p.communicate() logger.debug('returned: %s' % p.returncode) if p.returncode: raise ProcessError(' '.join(args), out, err, p.returncode) return err.rstrip()
def mock_vgs(cmd, vg, **kwargs): raise ProcessError('%s %s' % (cmd, vg), '', '%s is broken' % vg, -1)
def mock_vgs(cmd, vg, **kwargs): raise ProcessError('%s %s' % (cmd, vg), '', '%s not found' % vg, 5)
def mock_lvcreate_v2(cmd, vg, **kwargs): raise ProcessError('%s %s' % (cmd, vg), '', 'insufficient free space', 5)
def mock_lvcreate_v1(cmd, vg, **kwargs): raise ProcessError('%s %s' % (cmd, vg), '', 'Insufficient free extents', 5)
def raise_exc(*args, **kwargs): e = ProcessError('fake ietadm', '-1', 'error', 'SOS') raise DeviceBusy(e)