Sha256: e241496b5c885d572144ed7b18ecaee8a7562f1f825d45e93451852b3d8a4504

Contents?: true

Size: 1.29 KB

Versions: 2

Compression:

Stored size: 1.29 KB

Contents

module Rubyipmi::Freeipmi

  class BmcConfig < Rubyipmi::Freeipmi::BaseCommand

    def initialize(opts = ObservableHash.new)
      super("bmc-config", opts)
      @sections = []

    end

    def section(section)
      @options["checkout"] = false
      @options["section"] = section
      value = runcmd
      @options.delete_notify("checkout")
      @options.delete_notify("section")
      return @result
    end

    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


    # returns the entire bmc-config configuration, can take a while to execute
    def configuration
      @options["checkout"] = false
      value = runcmd
      @options.delete_notify("checkout")
      @result
    end

    # Returns a list of available sections to inspect
    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


  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
rubyipmi-0.8.1 lib/rubyipmi/freeipmi/commands/bmcconfig.rb
rubyipmi-0.7.0 lib/rubyipmi/freeipmi/commands/bmcconfig.rb