Sha256: d714b209e827e42f2264d01123cd79a87baa6ab4310746d73a978841aa4cfdb1

Contents?: true

Size: 739 Bytes

Versions: 2

Compression:

Stored size: 739 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)
      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

2 entries across 2 versions & 1 rubygems

Version Path
rubyipmi-0.11.1 lib/rubyipmi/freeipmi/commands/bmcdevice.rb
rubyipmi-0.11.0 lib/rubyipmi/freeipmi/commands/bmcdevice.rb