Project

General

Profile

« Previous | Next » 

Revision 71b45148

Added by Ohad Levy almost 12 years ago

  • ID 71b451482bcef12f4c991ef1bb6ce529025f4472

fixes #1737 - make sure mac based matching are case insensetive

View differences:

app/controllers/unattended_controller.rb
end
# we try to match first based on the MAC, falling back to the IP
conditions = (!maclist.empty? ? {:mac => maclist} : {:ip => ip})
conditions = maclist.empty? ? {:ip => ip} : [ "lower(mac) IN (?)", maclist.map(&:downcase) ]
@host = Host.first(:include => [:architecture, :medium, :operatingsystem, :domain], :conditions => conditions)
unless @host
logger.info "#{controller_name}: unable to find ip/mac match for #{ip}"

Also available in: Unified diff