Sha256: 6e26c705886f743f5daa866a63341506557605f5fd9ee1c504c5eba436b85b24

Contents?: true

Size: 751 Bytes

Versions: 5

Compression:

Stored size: 751 Bytes

Contents

module Rubyipmi::Freeipmi

  class BmcDevice < Rubyipmi::Freeipmi::BaseCommand

    def initialize(opts = ObservableHash.new)
      super("bmc-device", opts)
    end

    # runs a command like bmc-device --cold-reset
    def command(opt)
      @options[opt] = false
      value = runcmd
      @options.delete_notify(opt)
      return value
    end

    # reset the bmc device, useful for debugging and troubleshooting
    def reset(type='cold')
      if ['cold', 'warm'].include?(type)
        key = "#{type}-reset"
        command(key)
      else
        logger.error("reset type: #{type} is not a valid choice, use warm or cold") if logger
        raise "reset type: #{type} is not a valid choice, use warm or cold"
      end
    end



  end


end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
rubyipmi-0.10.0 lib/rubyipmi/freeipmi/commands/bmcdevice.rb
rubyipmi-0.9.3 lib/rubyipmi/freeipmi/commands/bmcdevice.rb
rubyipmi-0.9.2 lib/rubyipmi/freeipmi/commands/bmcdevice.rb
rubyipmi-0.9.1 lib/rubyipmi/freeipmi/commands/bmcdevice.rb
rubyipmi-0.9.0 lib/rubyipmi/freeipmi/commands/bmcdevice.rb