# File lib/rubyipmi/ipmitool/errorcodes.rb, line 17 def self.code @@codes end
# File lib/rubyipmi/ipmitool/errorcodes.rb, line 13 def self.length @@codes.length end
# File lib/rubyipmi/ipmitool/errorcodes.rb, line 21 def self.search(code) fix = @@codes.fetch(code,nil) if fix.nil? @@codes.each do | error, result | # the error should be a subset of the actual erorr if code =~ /.*#{error}.*/ return result end end else return fix end raise "No Fix found" if fix.nil? end
# File lib/rubyipmi/ipmitool/errorcodes.rb, line 37 def throwError # Find out what kind of error is happening, parse results # Check for authentication or connection issue if @result =~ /timeout|timed\ out/ code = "ipmi call: #{@lastcall} timed out" raise code else code = @result.split(":").last.chomp.strip if not @result.empty? end case code when "invalid hostname" raise code when "password invalid" raise code when "username invalid" raise code else raise :ipmierror, code end end