From 68acb59bf77d8d818489b1e2a97491cb7f327a0a Mon Sep 17 00:00:00 2001 From: Ashley Penney Date: Tue, 22 Apr 2014 23:14:16 +0200 Subject: Adjust the regular expression for facts. Previously this was incorrectly handling facts that were of the form foo=1+1=2 due to the ='s in the actual fact contents. Fix this and add tests to try and prevent regressions. --- lib/facter/facter_dot_d.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/facter') diff --git a/lib/facter/facter_dot_d.rb b/lib/facter/facter_dot_d.rb index e414b20..2c096b0 100644 --- a/lib/facter/facter_dot_d.rb +++ b/lib/facter/facter_dot_d.rb @@ -40,7 +40,7 @@ class Facter::Util::DotD def txt_parser(file) File.readlines(file).each do |line| - if line =~ /^(.+)=(.+)$/ + if line =~ /^([^=]+)=(.+)$/ var = $1; val = $2 Facter.add(var) do -- cgit v1.2.3