From e2926a2046a1e2b23339426fc328c8be6f884d76 Mon Sep 17 00:00:00 2001 From: Michael Still Date: Mon, 19 Mar 2018 12:07:19 +1100 Subject: [PATCH] Sync xenapi and libvirt on what flags to pass e2fsck. I can't see a good reason for the two drivers to use different flags, and this simplifies the code a little. Change-Id: I55cdc22ce8f95dff0cfd1a31b58582fc4b3ea48f blueprint: hurrah-for-privsep-again --- nova/tests/unit/virt/xenapi/test_vm_utils.py | 7 +++---- nova/virt/xenapi/vm_utils.py | 2 +- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/nova/tests/unit/virt/xenapi/test_vm_utils.py b/nova/tests/unit/virt/xenapi/test_vm_utils.py index fb2b82cd4f38..81a52c413d42 100644 --- a/nova/tests/unit/virt/xenapi/test_vm_utils.py +++ b/nova/tests/unit/virt/xenapi/test_vm_utils.py @@ -353,7 +353,7 @@ class ResizeHelpersTestCase(VMUtilsTestBase): vm_utils._resize_part_and_fs('fake', 0, 20, 10, 'boot') mock_fsck.assert_has_calls([ - mock.call(partition_path, flags='-fy')]) + mock.call(partition_path)]) mock_resize2fs.assert_has_calls([ mock.call(partition_path, None, size='10s')]) mock_resize.assert_has_calls([ @@ -393,8 +393,7 @@ class ResizeHelpersTestCase(VMUtilsTestBase): self.assertRaises(exception.ResizeError, vm_utils._resize_part_and_fs, "fake", 0, 20, 10, "boot") - mock_fsck.assert_has_calls([ - mock.call('/dev/fake1', flags='-fy')]) + mock_fsck.assert_has_calls([mock.call('/dev/fake1')]) @mock.patch('nova.privsep.fs.ext_journal_disable') @mock.patch('nova.privsep.fs.ext_journal_enable') @@ -409,7 +408,7 @@ class ResizeHelpersTestCase(VMUtilsTestBase): vm_utils._resize_part_and_fs('fake', 0, 20, 30, '') mock_fsck.assert_has_calls([ - mock.call(partition_path, flags='-fy')]) + mock.call(partition_path)]) mock_resize2fs.assert_has_calls([ mock.call(partition_path, None)]) mock_resize.assert_has_calls([ diff --git a/nova/virt/xenapi/vm_utils.py b/nova/virt/xenapi/vm_utils.py index e01c7b13f6ef..71fe41aee67f 100644 --- a/nova/virt/xenapi/vm_utils.py +++ b/nova/virt/xenapi/vm_utils.py @@ -2296,7 +2296,7 @@ def _resize_part_and_fs(dev, start, old_sectors, new_sectors, flags): partition_path = utils.make_dev_path(dev, partition=1) # Replay journal if FS wasn't cleanly unmounted - nova.privsep.fs.e2fsck(partition_path, flags='-fy') + nova.privsep.fs.e2fsck(partition_path) # Remove ext3 journal (making it ext2) nova.privsep.fs.ext_journal_disable(partition_path)