Class: Rubyipmi::Freeipmi::Bmc

Inherits:
BaseCommand show all
Defined in:
lib/rubyipmi/freeipmi/commands/bmc.rb

Instance Attribute Summary collapse

Attributes inherited from BaseCommand

#cmd, #lastcall, #max_retry_count, #options, #passfile, #result

Instance Method Summary collapse

Methods inherited from BaseCommand

#find_fix, #makecommand, #max_retry_count, #setpass, #validate_status

Methods inherited from BaseCommand

#dump_command, #find_fix, #locate_command, #logger, #makecommand, #removepass, #run, #runcmd, #setpass, #update, #validate_status

Constructor Details

#initialize(opts = ObservableHash.new) ⇒ Bmc

Returns a new instance of Bmc.



6
7
8
9
# File 'lib/rubyipmi/freeipmi/commands/bmc.rb', line 6

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

Instance Attribute Details

#configObject

attr_accessor :options



4
5
6
# File 'lib/rubyipmi/freeipmi/commands/bmc.rb', line 4

def config
  @config
end

Instance Method Details

#deviceObject



46
47
48
# File 'lib/rubyipmi/freeipmi/commands/bmc.rb', line 46

def device
  @bmcdevice ||= Rubyipmi::Freeipmi::BmcDevice.new(options)
end

#guidObject



30
31
32
# File 'lib/rubyipmi/freeipmi/commands/bmc.rb', line 30

def guid
  information.guid
end

#infoObject



18
19
20
21
22
23
24
# File 'lib/rubyipmi/freeipmi/commands/bmc.rb', line 18

def info
  if @bmcinfo.length > 0
    @bmcinfo
  else
    information.retrieve
  end
end

#informationObject



42
43
44
# File 'lib/rubyipmi/freeipmi/commands/bmc.rb', line 42

def information
  @info ||= Rubyipmi::Freeipmi::BmcInfo.new(options)
end

#lanObject



38
39
40
# File 'lib/rubyipmi/freeipmi/commands/bmc.rb', line 38

def lan
  @lan ||= Rubyipmi::Freeipmi::Lan.new(options)
end

#reset(type = 'cold') ⇒ Object



26
27
28
# File 'lib/rubyipmi/freeipmi/commands/bmc.rb', line 26

def reset(type = 'cold')
  device.reset(type)
end

#versionObject



11
12
13
14
15
16
# File 'lib/rubyipmi/freeipmi/commands/bmc.rb', line 11

def version
  @options['version'] = false
  runcmd
  @options.delete_notify('version')
  @result.slice(/\d\.\d.\d/)
end