XenAPI: Pass expected return codes to resize2fs
None is not tolerated by ProcessUtils, therefore make sure that [0] is passed as the expected return code Change-Id: I7d6335633479dfd7715444ef4aefc85ed41b8fa3 Closes-Bug: #1771137
This commit is contained in:
parent
36345f34c4
commit
eec0fe59ff
|
@ -353,7 +353,7 @@ class ResizeHelpersTestCase(VMUtilsTestBase):
|
|||
mock_fsck.assert_has_calls([
|
||||
mock.call(partition_path)])
|
||||
mock_resize2fs.assert_has_calls([
|
||||
mock.call(partition_path, None, size='10s')])
|
||||
mock.call(partition_path, [0], size='10s')])
|
||||
mock_resize.assert_has_calls([
|
||||
mock.call(dev_path, 0, 9, True)])
|
||||
mock_disable_journal.assert_has_calls([
|
||||
|
@ -408,7 +408,7 @@ class ResizeHelpersTestCase(VMUtilsTestBase):
|
|||
mock_fsck.assert_has_calls([
|
||||
mock.call(partition_path)])
|
||||
mock_resize2fs.assert_has_calls([
|
||||
mock.call(partition_path, None)])
|
||||
mock.call(partition_path, [0])])
|
||||
mock_resize.assert_has_calls([
|
||||
mock.call(dev_path, 0, 29, False)])
|
||||
mock_disable_journal.assert_has_calls([
|
||||
|
|
|
@ -2294,7 +2294,7 @@ def _resize_part_and_fs(dev, start, old_sectors, new_sectors, flags):
|
|||
if new_sectors < old_sectors:
|
||||
# Resizing down, resize filesystem before partition resize
|
||||
try:
|
||||
nova.privsep.fs.resize2fs(partition_path, None, size='%ds' % size)
|
||||
nova.privsep.fs.resize2fs(partition_path, [0], size='%ds' % size)
|
||||
except processutils.ProcessExecutionError as exc:
|
||||
LOG.error(six.text_type(exc))
|
||||
reason = _("Shrinking the filesystem down with resize2fs "
|
||||
|
@ -2307,7 +2307,7 @@ def _resize_part_and_fs(dev, start, old_sectors, new_sectors, flags):
|
|||
|
||||
if new_sectors > old_sectors:
|
||||
# Resizing up, resize filesystem after partition resize
|
||||
nova.privsep.fs.resize2fs(partition_path, None)
|
||||
nova.privsep.fs.resize2fs(partition_path, [0])
|
||||
|
||||
# Add back journal
|
||||
nova.privsep.fs.ext_journal_enable(partition_path)
|
||||
|
|
Loading…
Reference in New Issue