diff --git a/lib/puppet/provider/filesystem/lvm.rb b/lib/puppet/provider/filesystem/lvm.rb index a5422f56..c13216d3 100644 --- a/lib/puppet/provider/filesystem/lvm.rb +++ b/lib/puppet/provider/filesystem/lvm.rb @@ -18,7 +18,12 @@ def destroy end def fstype - %r{\bTYPE=\"(\S+)\"}.match(blkid(@resource[:name]))[1] + type_match = %r{\bTYPE=\"(\S+)\"}.match(blkid(@resource[:name])) + # when creating FS on a non LVM partition that already exists but does not have FS + # blkid output does not contain `TYPE=....` -> type_match is nil + if type_match + type_match[1] + end rescue Puppet::ExecutionFailure nil end