Пример #1
0
 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()
Пример #2
0
 def mock_vgs(cmd, vg, **kwargs):
     raise ProcessError('%s %s' % (cmd, vg), '',
                        '%s is broken' % vg, -1)
Пример #3
0
 def mock_vgs(cmd, vg, **kwargs):
     raise ProcessError('%s %s' % (cmd, vg), '',
                        '%s not found' % vg, 5)
Пример #4
0
 def mock_lvcreate_v2(cmd, vg, **kwargs):
     raise ProcessError('%s %s' % (cmd, vg), '',
                        'insufficient free space', 5)
Пример #5
0
 def mock_lvcreate_v1(cmd, vg, **kwargs):
     raise ProcessError('%s %s' % (cmd, vg), '',
                        'Insufficient free extents', 5)
Пример #6
0
 def raise_exc(*args, **kwargs):
     e = ProcessError('fake ietadm', '-1', 'error', 'SOS')
     raise DeviceBusy(e)