Skip to content

Commit

Permalink
Import correctly hosts entries
Browse files Browse the repository at this point in the history
  • Loading branch information
teclator committed May 20, 2020
1 parent f4abc6a commit cfd95bc
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/modules/Host.rb
Original file line number Diff line number Diff line change
Expand Up @@ -145,11 +145,9 @@ def Import(settings)
imported_hosts = settings.fetch("hosts", {})

# convert from old format to the new one
# use ::1 entry as a reference
if (imported_hosts["::1"] || []).size > 1
imported_hosts.each_pair do |k, v|
imported_hosts[k] = [v.join(" ")]
end
imported_hosts.each_pair do |k, v|
names = v.join(" ")
imported_hosts[k] = names.empty? ? [] : [names]
end

imported_hosts.each_pair do |ip, names|
Expand Down

0 comments on commit cfd95bc

Please sign in to comment.