MODULES-780 Don't blow up on unicode characters.
Gotta love the difference between Ruby 1.8.7 not caring and every subsequent version exploding.
This commit is contained in:
parent
345aef1d01
commit
14b3beda74
1 changed files with 5 additions and 0 deletions
|
@ -26,6 +26,11 @@ Puppet::Type.type(:apt_key).provide(:apt_key) do
|
|||
commands :apt_key => 'apt-key'
|
||||
|
||||
def self.instances
|
||||
if RUBY_VERSION > '1.8.7'
|
||||
key_output = apt_key('list').encode('UTF-8', 'binary', :invalid => :replace, :undef => :replace, :replace => '')
|
||||
else
|
||||
key_output = apt_key('list')
|
||||
end
|
||||
key_array = apt_key('list').split("\n").collect do |line|
|
||||
line_hash = key_line_hash(line)
|
||||
next unless line_hash
|
||||
|
|
Loading…
Reference in a new issue