Class: Elesai::Megacli::AdpAllInfo_aAll

Inherits:
Megacli
  • Object
show all
Defined in:
lib/elesai/megacli/_adpallinfo_aall.rb

Instance Method Summary collapse

Methods inherited from Megacli

#adapter_line, #adapter_match, #attribute_line, #attribute_match, #exit_line, #exit_match, #on_adapter_entry, #on_adapter_exit, #on_attribute_entry, #on_attribute_exit, #on_exit_entry, #on_start_exit

Constructor Details

#initializeAdpAllInfo_aAll

Returns a new instance of AdpAllInfo_aAll.



5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# 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

Instance Method Details

#on_section_entry(old_state, event, *args) ⇒ Object



86
87
88
89
90
91
92
93
# 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) ⇒ Object



95
96
97
98
# 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) ⇒ Object



31
32
33
34
# 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) ⇒ Object

Line Handlers



82
83
84
# 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) ⇒ Object

Match Handlers



75
76
77
78
# 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