# File lib/rubyipmi/freeipmi/errorcodes.rb, line 18 def self.search(code) # example error code: # "/usr/local/sbin/bmc-info: authentication type unavailable for attempted privilege level\n" code.chomp! # clean up newline code = code.split(':').last.strip # clean up left hand side and strip white space from sides fix = @@codes.fetch(code,nil) if fix.nil? @@codes.each do | error, result | if code =~ /.*#{error}.*/i fix = result end end end raise "No Fix found" if fix.nil? return fix end