Sha256: 6932de0e615251fd0596d3e63006e81bf0dff33e4fd1a31af2ccb528570f22cb

Contents?: true

Size: 1.06 KB

Versions: 4

Compression:

Stored size: 1.06 KB

Contents

require 'rubyipmi/ipmitool/errorcodes'
require 'rubyipmi/observablehash'
require 'rubyipmi/commands/basecommand'
require 'rubyipmi/ipmitool/commands/basecommand'

Dir[File.dirname(__FILE__) + '/commands/*.rb'].each do |file|
  require "#{file.split(".rb").first}"
end

module Rubyipmi
  module Ipmitool

    class Connection

      attr_accessor :options


      def initialize(user, pass, host)
        @options = Rubyipmi::ObservableHash.new
        raise("Must provide a host to connect to") unless host
        @options["H"] = host
        # Credentials can also be stored in the freeipmi configuration file
        # So they are not required
        @options["U"] = user if user
        @options["P"] = pass if pass
        # default to IPMI 2.0 communication
        #@options["I"] = "lanplus"

        #getWorkArounds
      end

      def provider
        return "ipmitool"
      end

      def bmc
        @bmc ||= Rubyipmi::Ipmitool::Bmc.new(@options)
      end

      def chassis
        @chassis ||= Rubyipmi::Ipmitool::Chassis.new(@options)
      end

    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
rubyipmi-0.3.3 lib/rubyipmi/ipmitool/connection.rb
rubyipmi-0.3.2 lib/rubyipmi/ipmitool/connection.rb
rubyipmi-0.3.1 lib/rubyipmi/ipmitool/connection.rb
rubyipmi-0.3.0 lib/rubyipmi/ipmitool/connection.rb