Merge "LVM: Retry lvextend commands on code 139"

This commit is contained in:
Zuul 2021-08-18 22:29:50 +00:00 committed by Gerrit Code Review
commit d3ab9ccbaf
2 changed files with 2 additions and 3 deletions

View File

@ -832,8 +832,7 @@ class LVM(executor.Executor):
try:
cmd = LVM.LVM_CMD_PREFIX + ['lvextend', '-L', new_size,
'%s/%s' % (self.vg_name, lv_name)]
self._execute(*cmd, root_helper=self._root_helper,
run_as_root=True)
self._run_lvm_command(cmd)
except putils.ProcessExecutionError as err:
LOG.exception('Error extending Volume')
LOG.error('Cmd :%s', err.cmd)

View File

@ -456,7 +456,7 @@ class BrickLvmTestCase(test.TestCase):
@ddt.data(True, False)
def test_lv_extend(self, has_snapshot):
with mock.patch.object(self.vg, '_execute'):
with mock.patch.object(self.vg, '_execute', return_value=('', '')):
with mock.patch.object(self.vg, 'lv_has_snapshot'):
self.vg.deactivate_lv = mock.MagicMock()
self.vg.activate_lv = mock.MagicMock()