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 5
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 43
def configuration
  require 'pry'
  binding.pry
  @options["checkout"] = false
  value = 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 53
def listsections
  if @sections.length < 1
    @options["listsections"] = false
    value = runcmd
    @options.delete_notify("listsections")
    if value
      @sections = @result.split(/\n/)
    end
  end
  @sections
end
section(section) click to toggle source
# File lib/rubyipmi/freeipmi/commands/bmcconfig.rb, line 19
def section(section)
  @options["checkout"] = false
  @options["section"] = section
  value = runcmd
  @options.delete_notify("checkout")
  @options.delete_notify("section")
  return @result
end
setsection(section, key, value) click to toggle source
# File lib/rubyipmi/freeipmi/commands/bmcconfig.rb, line 28
def setsection(section, key, value)
  keypair = "#{section}:#{key}=#{value}"
  @options["commit"] = false
  if not keypair.empty?
    @options["key-pair"] = keypair
    value = runcmd
    @options.delete_notify("commit")
    @options.delete_notify("key-pair")
    return value
  end
  return false
end
verbose(on=false) click to toggle source
# File lib/rubyipmi/freeipmi/commands/bmcconfig.rb, line 11
def verbose(on=false)
  if on
    @options['verbose'] = false
  else
    @options.delete_notify('verbose')
  end
end