Fixed comment parsing for OpenBSD service provider

This commit is contained in:
Ossi Salmi 2011-11-28 11:08:59 +02:00 committed by Timo Mkinen
parent 78d6eddb2c
commit 384ea48e62

View file

@ -20,7 +20,10 @@ Puppet::Type.type(:service).provide :openbsd, :parent => :base do
def rcvar
name = @resource[:name]
File.open(@@rcconf).each do |line|
return line.strip.split("=", 2) if line =~ /^#{name}(_flags)?=/
if line =~ /^#{name}(_flags)?=/
line = line.sub(/#.*/, "")
return line.strip.split("=", 2)
end
end
nil
end
@ -28,7 +31,10 @@ Puppet::Type.type(:service).provide :openbsd, :parent => :base do
def rcvar_local
name = @resource[:name]
File.open(@@rcconf_local).each do |line|
return line.strip.split("=", 2) if line =~ /^#{name}(_flags)?=/
if line =~ /^#{name}(_flags)?=/
line = line.sub(/#.*/, "")
return line.strip.split("=", 2)
end
end
nil
end