class Rubyipmi::Freeipmi::ErrorCodes
Constants
- CODES
Public Class Methods
code()
click to toggle source
# File lib/rubyipmi/freeipmi/errorcodes.rb, line 12 def self.code CODES end
length()
click to toggle source
# File lib/rubyipmi/freeipmi/errorcodes.rb, line 8 def self.length CODES.length end
search(code)
click to toggle source
# File lib/rubyipmi/freeipmi/errorcodes.rb, line 16 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| fix = result if code =~ /.*#{error}.*/i end end raise "No Fix found" if fix.nil? fix end