Browse Source

Merge "Update LVM volume extend" into stable/train

tags/9.1.4
Zuul 1 week ago
committed by Gerrit Code Review
parent
commit
8746af3490
2 changed files with 2 additions and 5 deletions
  1. +1
    -2
      manila/share/drivers/lvm.py
  2. +1
    -3
      manila/tests/share/drivers/test_lvm.py

+ 1
- 2
manila/share/drivers/lvm.py View File

@@ -98,7 +98,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):
@@ -379,7 +379,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):


+ 1
- 3
manila/tests/share/drivers/test_lvm.py View File

@@ -467,8 +467,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']
@@ -491,7 +489,7 @@ class LVMShareDriverTestCase(test.TestCase):
'lvextend',
'-L',
'3G',
'-n',
'-r',
'device_name',
run_as_root=True)



Loading…
Cancel
Save