Class: Rubyipmi::Freeipmi::BmcConfig
- Inherits:
-
BaseCommand
- Object
- BaseCommand
- BaseCommand
- Rubyipmi::Freeipmi::BmcConfig
- Defined in:
- lib/rubyipmi/freeipmi/commands/bmcconfig.rb
Instance Attribute Summary
Attributes inherited from BaseCommand
#cmd, #lastcall, #max_retry_count, #options, #passfile, #result
Instance Method Summary collapse
-
#configuration ⇒ Object
returns the entire bmc-config configuration, can take a while to execute.
-
#initialize(opts = ObservableHash.new) ⇒ BmcConfig
constructor
A new instance of BmcConfig.
-
#listsections ⇒ Object
Returns a list of available sections to inspect.
- #section(section) ⇒ Object
- #setsection(section, key, value) ⇒ Object
- #verbose(on = false) ⇒ Object
Methods inherited from BaseCommand
#find_fix, #makecommand, #max_retry_count, #setpass, #validate_status
Methods inherited from BaseCommand
#dump_command, #find_fix, #locate_command, #logger, #makecommand, #removepass, #run, #runcmd, #setpass, #update, #validate_status
Constructor Details
#initialize(opts = ObservableHash.new) ⇒ BmcConfig
Returns a new instance of BmcConfig.
5 6 7 8 9 |
# File 'lib/rubyipmi/freeipmi/commands/bmcconfig.rb', line 5 def initialize(opts = ObservableHash.new) super("bmc-config", opts) @sections = [] end |
Instance Method Details
#configuration ⇒ Object
returns the entire bmc-config configuration, can take a while to execute
43 44 45 46 47 48 49 50 |
# File 'lib/rubyipmi/freeipmi/commands/bmcconfig.rb', line 43 def configuration require 'pry' binding.pry ["checkout"] = false value = runcmd .delete_notify("checkout") @result end |
#listsections ⇒ Object
Returns a list of available sections to inspect
53 54 55 56 57 58 59 60 61 62 63 |
# File 'lib/rubyipmi/freeipmi/commands/bmcconfig.rb', line 53 def listsections if @sections.length < 1 ["listsections"] = false value = runcmd .delete_notify("listsections") if value @sections = @result.split(/\n/) end end @sections end |
#section(section) ⇒ Object
19 20 21 22 23 24 25 26 |
# File 'lib/rubyipmi/freeipmi/commands/bmcconfig.rb', line 19 def section(section) ["checkout"] = false ["section"] = section value = runcmd .delete_notify("checkout") .delete_notify("section") return @result end |
#setsection(section, key, value) ⇒ Object
28 29 30 31 32 33 34 35 36 37 38 39 |
# File 'lib/rubyipmi/freeipmi/commands/bmcconfig.rb', line 28 def setsection(section, key, value) keypair = "#{section}:#{key}=#{value}" ["commit"] = false if not keypair.empty? ["key-pair"] = keypair value = runcmd .delete_notify("commit") .delete_notify("key-pair") return value end return false end |
#verbose(on = false) ⇒ Object
11 12 13 14 15 16 17 |
# File 'lib/rubyipmi/freeipmi/commands/bmcconfig.rb', line 11 def verbose(on=false) if on ['verbose'] = false else .delete_notify('verbose') end end |