Hello Puppet User,
Infos:
Puppet-client-version = 3.8.4
facter= 2.4.4
Puppetserver = 4.10.0
I wrote a fact to discover all firewallrules on a windows machine.
Factname is windows_firewallrules.rb and returnvalue is a nested hash.
if i execute following command.
facter -p windows_firewallrules
I can see all firewallrules correctly. But if i execute
I get a error and the puppetrun stops.
Errormessage:
invalid byte sequence in UTF-8
I found out the issue is caused from my windows_firewallrules fact.
I have already set the encoding fix to UTF-8.
for example:
name.encode!('UTF-8', :invalid => :replace)
key.encode!('UTF-8', :invalid => :replace)
value.encode!('UTF-8', :invalid => :replace)
windows_firewallrules[name][key] = value
Strangely if i iterate through my nested hash (windows_firewallrules) i cant see anythink wrong.
for example:
windows_firewallrules.each do |k1, v1|
if k1.encoding.to_s != 'UTF-8'
puts k1.encoding
end
v1.each do |k2, v2|
if k2.encoding.to_s != 'UTF-8'
puts k2.encoding
end
if v2.encoding.to_s != 'UTF-8'
puts v2.encoding
end
end
end
Has anyone a idea ?
Best regards
mobios