diff --git a/manila/share/drivers/lvm.py b/manila/share/drivers/lvm.py index fe32d1be3e..b9b0f7ab66 100644 --- a/manila/share/drivers/lvm.py +++ b/manila/share/drivers/lvm.py @@ -108,7 +108,7 @@ class LVMMixin(driver.ExecuteMixin): device_name, run_as_root=True) def _extend_container(self, share, device_name, size): - cmd = ['lvextend', '-L', '%sG' % size, '-n', device_name] + cmd = ['lvextend', '-L', '%sG' % size, '-r', device_name] self._try_execute(*cmd, run_as_root=True) def _deallocate_container(self, share_name): @@ -392,7 +392,6 @@ class LVMShareDriver(LVMMixin, driver.ShareDriver): def extend_share(self, share, new_size, share_server=None): device_name = self._get_local_path(share) self._extend_container(share, device_name, new_size) - self._execute('resize2fs', device_name, run_as_root=True) def revert_to_snapshot(self, context, snapshot, share_access_rules, snapshot_access_rules, share_server=None): diff --git a/manila/tests/share/drivers/test_lvm.py b/manila/tests/share/drivers/test_lvm.py index addb1fc30e..09f4452d92 100644 --- a/manila/tests/share/drivers/test_lvm.py +++ b/manila/tests/share/drivers/test_lvm.py @@ -487,8 +487,6 @@ class LVMShareDriverTestCase(test.TestCase): self._driver.extend_share(self.share, 3) self._driver._extend_container.assert_called_once_with(self.share, local_path, 3) - self._driver._execute.assert_called_once_with('resize2fs', local_path, - run_as_root=True) def test_ssh_exec_as_root(self): command = ['fake_command'] @@ -511,7 +509,7 @@ class LVMShareDriverTestCase(test.TestCase): 'lvextend', '-L', '3G', - '-n', + '-r', 'device_name', run_as_root=True)