Skip to content

Commit

Permalink
Fix physical_volumes provisioning with 'followsymlinks' enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
Siarhei Rasiukevich committed Sep 17, 2019
1 parent a96170f commit b70c7b0
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions lib/puppet/provider/volume_group/lvm.rb
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,21 @@ def exists?
end

def physical_volumes=(new_volumes = [])
# Need to replace device path with real names, instead of symlink
if @resource.parameter(:followsymlinks).value == :true then
new_volume_real = []
new_volumes.each do |s|
if File.symlink?(s)
device = File.expand_path(File.readlink(s), File.dirname(s))
new_volume_real.push device
else
real_should.push s
end
end
new_volumes = new_volume_real
end


# Only take action if createonly is false just to be safe
# this is really only here to enforce the createonly setting
# if something goes wrong in physical_volumes
Expand Down

0 comments on commit b70c7b0

Please sign in to comment.