class Rubyipmi::Freeipmi::ErrorCodes
Public Class Methods
code()
click to toggle source
# File lib/rubyipmi/freeipmi/errorcodes.rb, line 14 def self.code @@codes end
length()
click to toggle source
# File lib/rubyipmi/freeipmi/errorcodes.rb, line 10 def self.length @@codes.length end
search(code)
click to toggle source
# 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