summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorMathieu Parent <Mathieu.PARENT@nantesmetropole.fr>2017-04-18 13:16:39 +0200
committerMathieu Parent <Mathieu.PARENT@nantesmetropole.fr>2017-04-18 13:16:39 +0200
commitec720cf8808b231ce3756c19d9176723b56bde37 (patch)
treef5e6e9d12af1927b83d1d9263ddb5b6bc60a18c5 /lib
parentbf4ee151b9315581c8bd01a483314b8dfd430c11 (diff)
Ruby 1.8 doesn't support open_args
Regression from #726
Diffstat (limited to 'lib')
-rw-r--r--lib/puppet/provider/file_line/ruby.rb7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/puppet/provider/file_line/ruby.rb b/lib/puppet/provider/file_line/ruby.rb
index fbf7d8e..42f287a 100644
--- a/lib/puppet/provider/file_line/ruby.rb
+++ b/lib/puppet/provider/file_line/ruby.rb
@@ -40,7 +40,12 @@ Puppet::Type.type(:file_line).provide(:ruby) do
# file; for now assuming that this type is only used on
# small-ish config files that can fit into memory without
# too much trouble.
- @lines ||= File.readlines(resource[:path], :encoding => resource[:encoding])
+ begin
+ @lines ||= File.readlines(resource[:path], :encoding => resource[:encoding])
+ rescue TypeError => e
+ # Ruby 1.8 doesn't support open_args
+ @lines ||= File.readlines(resource[:path])
+ end
end
def match_regex