summaryrefslogtreecommitdiff
path: root/lib/puppet/type/file_line.rb
diff options
context:
space:
mode:
authorBryan Jen <bryan.jen@gmail.com>2016-06-28 16:45:56 -0700
committerBryan Jen <bryan.jen@gmail.com>2016-06-28 16:45:56 -0700
commit7b1250478c513a3c02c463ec7cdd62d427957400 (patch)
tree8e686cc97bd260bf91f6710175792c446b099992 /lib/puppet/type/file_line.rb
parent098e82e694704222200d42f2dd4b50ca6d9999fa (diff)
(MODULES-3507) Updates file_line path validation
Diffstat (limited to 'lib/puppet/type/file_line.rb')
-rw-r--r--lib/puppet/type/file_line.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/puppet/type/file_line.rb b/lib/puppet/type/file_line.rb
index f2c6937..a02b514 100644
--- a/lib/puppet/type/file_line.rb
+++ b/lib/puppet/type/file_line.rb
@@ -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