Merge pull request #610 from bmjen/modules-3507

(MODULES-3507) Updates file_line path validation
This commit is contained in:
Hunter Haugen 2016-06-29 07:15:39 -07:00 committed by GitHub
commit 50cf8bd5b7

View file

@ -93,8 +93,8 @@ Puppet::Type.newtype(:file_line) do
newparam(:path) do
desc 'The file Puppet will ensure contains the line specified by the line parameter.'
validate do |value|
unless (Puppet.features.posix? and value =~ /^\//) or (Puppet.features.microsoft_windows? and (value =~ /^.:\// or value =~ /^\/\/[^\/]+\/[^\/]+/))
raise(Puppet::Error, "File paths must be fully qualified, not '#{value}'")
unless Puppet::Util.absolute_path?(value)
raise Puppet::Error, "File paths must be fully qualified, not '#{value}'"
end
end
end