Parent

Rubyipmi::Freeipmi::ErrorCodes

Public Class Methods

code() click to toggle source
# File lib/rubyipmi/freeipmi/errorcodes.rb, line 15
def self.code
   @@codes
end
length() click to toggle source
# File lib/rubyipmi/freeipmi/errorcodes.rb, line 11
def self.length
  @@codes.length
end
search(code) click to toggle source
# File lib/rubyipmi/freeipmi/errorcodes.rb, line 19
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}.*/
        fix = result
      end
    end
  end
  raise "No Fix found" if fix.nil?
  return fix
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.