1
0
mirror of https://github.com/OpenNebula/one.git synced 2024-12-22 13:33:52 +03:00

Validate ext4 resize (#2789)

This commit is contained in:
Daniel Clavijo Coca 2019-01-10 04:50:46 -06:00 committed by Ruben S. Montero
parent b42186605a
commit 0d043e4c1c

View File

@ -163,8 +163,14 @@ class Mapper
Command.execute("#{COMMANDS[:xfs_growfs]} -d #{directory}", false)
when /ext/
Command.execute("#{COMMANDS[:e2fsck]} -f -y #{device}", false)
Command.execute("#{COMMANDS[:resize2fs]} #{device}", false)
rc, _o, e = Command.execute("#{COMMANDS[:e2fsck]} -f -y #{device}", false)
if rc.zero?
Command.execute("#{COMMANDS[:resize2fs]} #{device}", false)
else
OpenNebula.log_error "#{__method__}: failed to resize #{device}\n#{e}"
end
rc = mount_dev(device, directory)
else
OpenNebula.log_info "Skipped filesystem #{fs_type} resize"