(MODULES-3507) Updates file_line path validation

This commit is contained in:
Bryan Jen 2016-06-28 16:45:56 -07:00
parent 098e82e694
commit 7b1250478c

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