Merge branch '2.x' into 3.x
* 2.x: changed .count to .size to support legacy ruby
This commit is contained in:
commit
d2e0c53243
1 changed files with 1 additions and 1 deletions
|
@ -34,7 +34,7 @@ Puppet::Type.type(:file_line).provide(:ruby) do
|
||||||
|
|
||||||
def handle_create_with_match()
|
def handle_create_with_match()
|
||||||
regex = resource[:match] ? Regexp.new(resource[:match]) : nil
|
regex = resource[:match] ? Regexp.new(resource[:match]) : nil
|
||||||
match_count = lines.select { |l| regex.match(l) }.count
|
match_count = lines.select { |l| regex.match(l) }.size
|
||||||
if match_count > 1
|
if match_count > 1
|
||||||
raise Puppet::Error, "More than one line in file '#{resource[:path]}' matches pattern '#{resource[:match]}'"
|
raise Puppet::Error, "More than one line in file '#{resource[:path]}' matches pattern '#{resource[:match]}'"
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue