Skip to content
Closed
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions lib/puppet/provider/logical_volume/lvm.rb
Original file line number Diff line number Diff line change
Expand Up @@ -149,10 +149,10 @@ def create

def destroy
name_escaped = "#{@resource[:volume_group].gsub('-', '--')}-#{@resource[:name].gsub('-', '--')}"
if blkid(path) =~ %r{\bTYPE=\"(swap)\"}
if File.exist?(path) and blkid(path) =~ %r{\bTYPE=\"(swap)\"}
swapoff(path)
dmsetup('remove', name_escaped)
end
dmsetup('remove', name_escaped)
lvremove('-f', path)
end

Expand Down