Due to the fix for #1427 variables are now real instance
variables. Therfore we have to escape special characters
like ':' and '.' for variable names. Otherwise templates and with
that puppet will fail.
This patch will introduce an escaping (_) for such
variables.
It is clear that things like that should be fixed in facts,
however if one fact will contain a wrong character, the whole
puppet run will fail. Applying this patch will prevent puppet
to fail due to wrong characters in facter variable names.

Signed-off-by: duritong <[EMAIL PROTECTED]>
---
 lib/puppet/parser/templatewrapper.rb |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/lib/puppet/parser/templatewrapper.rb 
b/lib/puppet/parser/templatewrapper.rb
index 3b74e62..2d2ef9f 100644
--- a/lib/puppet/parser/templatewrapper.rb
+++ b/lib/puppet/parser/templatewrapper.rb
@@ -68,7 +68,7 @@ class Puppet::Parser::TemplateWrapper
         # to the regular methods.
         benchmark(:debug, "Bound template variables for #{file}") do
             scope.to_hash.each { |name, value| 
-                instance_variable_set("@#{name}", value) 
+                instance_variable_set("@#{name.to_s.gsub(/:|\./,'_')}", value) 
             }
         end
 
-- 
1.5.5.1


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Puppet Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/puppet-dev?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to