From 48965fb01c4822ff2046d61c7a033800437529e7 Mon Sep 17 00:00:00 2001 From: Travis Fields Date: Mon, 3 Aug 2015 09:08:53 -0700 Subject: [PATCH] (MODULES-1908) Munge the setting to ensure we always strip the whitespace --- lib/puppet/type/ini_setting.rb | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/puppet/type/ini_setting.rb b/lib/puppet/type/ini_setting.rb index 15ae2418c..0ec223ced 100644 --- a/lib/puppet/type/ini_setting.rb +++ b/lib/puppet/type/ini_setting.rb @@ -17,6 +17,12 @@ newparam(:setting) do desc 'The name of the setting to be defined.' + munge do |value| + if value =~ /(^\s|\s$)/ + Puppet.warn("Settings should not have spaces in the value, we are going to strip the whitespace") + end + value.lstrip.rstrip + end end newparam(:path) do