From 2418cee437a7eecb58e5c4b5ade077dacfadc2af Mon Sep 17 00:00:00 2001 From: mikej-hc Date: Fri, 15 Sep 2017 17:42:14 -0500 Subject: [PATCH 1/2] Fix sysctl -a line parsing for FreeBSD --- lib/puppet/provider/sysctl/augeas.rb | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/puppet/provider/sysctl/augeas.rb b/lib/puppet/provider/sysctl/augeas.rb index f08e0da..c9534d5 100644 --- a/lib/puppet/provider/sysctl/augeas.rb +++ b/lib/puppet/provider/sysctl/augeas.rb @@ -78,11 +78,10 @@ def self.instances(reference_resource = nil) resources ||= [] sysctl('-a').each_line do |line| - value = line.split('=') + value = line.split(/(=|:)/) key = value.shift.strip - - value = value.join('=').strip + value = value.shift.to_s.strip existing_index = resources.index{ |x| x[:name] == key } From b6eab3d09e6823b7056ef79cc33fc460f3419b5d Mon Sep 17 00:00:00 2001 From: mikej-hc Date: Mon, 18 Sep 2017 12:07:00 -0500 Subject: [PATCH 2/2] Fix sysctl -a line parsing for FreeBSD --- lib/puppet/provider/sysctl/augeas.rb | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/lib/puppet/provider/sysctl/augeas.rb b/lib/puppet/provider/sysctl/augeas.rb index c9534d5..eb0707d 100644 --- a/lib/puppet/provider/sysctl/augeas.rb +++ b/lib/puppet/provider/sysctl/augeas.rb @@ -78,10 +78,7 @@ def self.instances(reference_resource = nil) resources ||= [] sysctl('-a').each_line do |line| - value = line.split(/(=|:)/) - - key = value.shift.strip - value = value.shift.to_s.strip + key, value = line.split(/\s?[=:]\s?/,2) existing_index = resources.index{ |x| x[:name] == key }