Skip to content

Commit

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

# convert from old format to the new one
imported_hosts.each_pair do |k, v|
names = v.join(" ")
imported_hosts[k] = names.empty? ? [] : [names]
# 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
end

imported_hosts.each_pair do |ip, names|
Expand Down

0 comments on commit ac5d1ea

Please sign in to comment.