From 513796626d6564e1a30ed664fca7bd6ce9ff762a Mon Sep 17 00:00:00 2001 From: Rick Harris Date: Wed, 8 Feb 2012 03:18:03 +0000 Subject: Allow e2fsck to exit with 1 Fixes bug 928603 Change-Id: I431979bceb7ff5835167aceb10dfb0652b8fe310 --- nova/virt/xenapi/vm_utils.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/nova/virt/xenapi/vm_utils.py b/nova/virt/xenapi/vm_utils.py index 638042e35..91cbe2e38 100644 --- a/nova/virt/xenapi/vm_utils.py +++ b/nova/virt/xenapi/vm_utils.py @@ -1446,9 +1446,14 @@ def _resize_part_and_fs(dev, start, old_sectors, new_sectors): run_as_root=True) # fsck the disk + # # NOTE(sirp): using -p here to automatically repair filesystem, is # this okay? - utils.execute('e2fsck', '-f', '-p', partition_path, run_as_root=True) + # + # Exit Code 1 = File system errors corrected + # 2 = File system errors corrected, system needs a reboot + utils.execute('e2fsck', '-f', '-p', partition_path, run_as_root=True, + check_exit_code=[0, 1, 2]) if new_sectors < old_sectors: # Resizing down, resize filesystem before partition resize -- cgit