From d13aec89dd7edb4679b1a04a60859d0cd87f6521 Mon Sep 17 00:00:00 2001 From: Arjen Zonneveld Date: Thu, 6 Oct 2022 12:01:46 +0200 Subject: [PATCH] Do explicit string conversion on values too `to_s` the values too (like the attribute in line 129). This prevents the copious logging of lines like ``` [puppetserver] Puppet Ssh_authorized_key[arjen-ssh-rsa]['user']['key']['type'] contains a Net::BER::BerIdentifiedString value. It will be converted to the String 'ssh-rsa' ``` for each and every piece of data that gets used from the `ldapquery` results. --- lib/puppet_x/ldapquery.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/puppet_x/ldapquery.rb b/lib/puppet_x/ldapquery.rb index 41f8056..6c31a37 100644 --- a/lib/puppet_x/ldapquery.rb +++ b/lib/puppet_x/ldapquery.rb @@ -129,7 +129,7 @@ module PuppetX attr = attribute.to_s value_data = [] Array(values).flatten.each do |v| - value_data << v.chomp + value_data << v.to_s.chomp end entry_data[attr] = value_data end