class Rubyipmi::Freeipmi::BmcConfig

Public Class Methods

new(opts = ObservableHash.new) click to toggle source
Calls superclass method Rubyipmi::BaseCommand::new
# File lib/rubyipmi/freeipmi/commands/bmcconfig.rb, line 3
def initialize(opts = ObservableHash.new)
  super("bmc-config", opts)
  @sections = []
end

Public Instance Methods

configuration() click to toggle source

returns the entire bmc-config configuration, can take a while to execute

# File lib/rubyipmi/freeipmi/commands/bmcconfig.rb, line 39
def configuration
  @options["checkout"] = false
  runcmd
  @options.delete_notify("checkout")
  @result
end
listsections() click to toggle source

Returns a list of available sections to inspect

# File lib/rubyipmi/freeipmi/commands/bmcconfig.rb, line 47
def listsections
  if @sections.length < 1
    @options["listsections"] = false
    value = runcmd
    @options.delete_notify("listsections")
    @sections = @result.split(/\n/) if value
  end
  @sections
end
section(section) click to toggle source
# File lib/rubyipmi/freeipmi/commands/bmcconfig.rb, line 16
def section(section)
  @options["checkout"] = false
  @options["section"] = section
  runcmd
  @options.delete_notify("checkout")
  @options.delete_notify("section")
  @result
end
setsection(section, key, value) click to toggle source
# File lib/rubyipmi/freeipmi/commands/bmcconfig.rb, line 25
def setsection(section, key, value)
  keypair = "#{section}:#{key}=#{value}"
  @options["commit"] = false
  unless keypair.empty?
    @options["key-pair"] = keypair
    value = runcmd
    @options.delete_notify("commit")
    @options.delete_notify("key-pair")
    return value
  end
  false
end
verbose(on = false) click to toggle source
# File lib/rubyipmi/freeipmi/commands/bmcconfig.rb, line 8
def verbose(on = false)
  if on
    @options['verbose'] = false
  else
    @options.delete_notify('verbose')
  end
end