Skip to content

Commit ac4b04b

Browse files
committed
Array parsing suggestion
1 parent 715b11f commit ac4b04b

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

modules/auxiliary/admin/ldap/bad_successor.rb

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -228,9 +228,11 @@ def query_account(account_name)
228228

229229
attrs_to_copy.each do |key, value|
230230
if value.is_a?(Array)
231-
print_status("#{key} => [#{value.map(&:inspect).join(', ')}]")
232-
else
233-
print_status("#{key} => #{value.inspect}")
231+
if value.length == 1
232+
print_status("#{key} => #{value.first.inspect}")
233+
else
234+
print_status("#{key} => [#{value.map(&:inspect).join(', ')}]")
235+
end
234236
end
235237
end
236238
end

0 commit comments

Comments
 (0)