class Elesai::Megacli::AdpAllInfo_aAll

Public Class Methods

new() click to toggle source
# File lib/elesai/megacli/_adpallinfo_aall.rb, line 5
def initialize
  @megacli = { :adapter                     => { :re => /^Adapter\s+#*(?<value>\d+)/,                         :method => self.method(:adapter_match)    },
               :versions                    => { :re => /^Versions/,                                          :method => self.method(:section_match)    },
               :mfgdata                     => { :re => /^Mfg\.\s+Data/,                                      :method => self.method(:section_match)    },
               :imageversions               => { :re => /^Image Versions in Flash/,                           :method => self.method(:section_match)    },
               :pendingvensions             => { :re => /^Pending Images in Flash/,                           :method => self.method(:section_match)    },
               :pciinfo                     => { :re => /^PCI Info/,                                          :method => self.method(:section_match)    },
               :hwconfiguration             => { :re => /^HW Configuration/,                                  :method => self.method(:section_match)    },
               :setttings                   => { :re => /^Settings/,                                          :method => self.method(:section_match)    },
               :capabilities                => { :re => /^Capabilities/,                                      :method => self.method(:section_match)    },
               :status                      => { :re => /^Status/,                                            :method => self.method(:section_match)    },
               :limitations                 => { :re => /^Limitations/,                                       :method => self.method(:section_match)    },
               :devicepresent               => { :re => /^Device Present/,                                    :method => self.method(:section_match)    },
               :supportedadapteroperations  => { :re => /^Supported Adapter Operations/,                      :method => self.method(:section_match)    },
               :supportedvdoperations       => { :re => /^Supported VD Operations/,                           :method => self.method(:section_match)    },
               :supportedddoperations       => { :re => /^Supported PD Operations/,                           :method => self.method(:section_match)    },
               :errorcounters               => { :re => /^Error Counters/,                                    :method => self.method(:section_match)    },
               :clusterinformation          => { :re => /^ClusterInformation/,                                :method => self.method(:section_match)    },
               :defaultsettings             => { :re => /^Default Settings/,                                  :method => self.method(:section_match)    },
               :exit                        => { :re => /^Exit Code: /,                                       :method => self.method(:exit_match)       },
               :attribute                   => { :re => /^(?<key>[A-Za-z0-9()\s#'-.&]+)([:|=](?<value>.*))?/, :method => self.method(:attribute_match)  }
  }.freeze
  @command_arguments = "-adpallinfo -aall".freeze
  @command_output_file = "adpallinfo_aall".freeze
end

Public Instance Methods

on_section_entry(old_state, event, *args) click to toggle source
# File lib/elesai/megacli/_adpallinfo_aall.rb, line 86
def on_section_entry(old_state, event, *args)
  @log.debug "     [#{current_state}] on_entry: leaving #{old_state}; args: #{args}"
  unless @context.current.nil?
    @context.close if Elesai::LSI::Adapter::Section === @context.current
  end
  @context.current.add_section(args[0])
  @context.open(args[0])
end
on_section_exit(new_state, event, *args) click to toggle source
# File lib/elesai/megacli/_adpallinfo_aall.rb, line 95
def on_section_exit(new_state, event, *args)
  @log.debug "      [#{current_state}] on_exit: entering #{new_state}; args: #{args}"
  @context.flash!(new_state)
end
parse!(lsi,opts) click to toggle source
Calls superclass method
# File lib/elesai/megacli/_adpallinfo_aall.rb, line 31
def parse!(lsi,opts)
  fake = opts[:fake].nil? ? @command_arguments : File.join(opts[:fake],@command_output_file)
  super lsi, :fake => fake, :megacli => opts[:megacli]
end
section_line(section) click to toggle source

Line Handlers

# File lib/elesai/megacli/_adpallinfo_aall.rb, line 82
def section_line(section)
  @log.debug "  [#{current_state}] event: section_line: new #{section.inspect}"
end
section_match(k,match) click to toggle source

Match Handlers

# File lib/elesai/megacli/_adpallinfo_aall.rb, line 75
def section_match(k,match)
  @log.debug "ADPINFO_SECTION! #{k} -> #{match.string}"
  section_line!(LSI::Adapter::Section.new(k))
end